Spaces:
Runtime error
Runtime error
Create templates.py
Browse files- templates.py +115 -0
templates.py
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# filename: templates.py
|
| 2 |
+
|
| 3 |
+
# This file centralizes all user-facing text for easy management and future translation.
|
| 4 |
+
# Using f-strings or .format() allows us to insert dynamic values.
|
| 5 |
+
|
| 6 |
+
class BotResponses:
|
| 7 |
+
# --- Onboarding & General Help ---
|
| 8 |
+
WELCOME_MESSAGE = (
|
| 9 |
+
"**Namaste, {name}!** π\n\n"
|
| 10 |
+
"I am your personal Terabox Link Processor. I'm designed to be fast, fair, and easy to use.\n\n"
|
| 11 |
+
"β‘οΈ **How to use me:** Just send me any message containing one or more Terabox links.\n\n"
|
| 12 |
+
"Check out /help for more commands and information."
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
HELP_MESSAGE = (
|
| 16 |
+
"**Here's how I can assist you:**\n\n"
|
| 17 |
+
"1. **Direct Downloads:** Send me any Terabox link, and I'll send you the file.\n"
|
| 18 |
+
"2. **Batch Processing:** You can send multiple links in one message. I'll process them all as one job.\n"
|
| 19 |
+
"3. **Intelligent Caching:** If a file has been downloaded before by anyone, you'll get it instantly, for free!\n\n"
|
| 20 |
+
"**Available Commands:**\n"
|
| 21 |
+
" - `/myaccount` - Check your account status and subscription details.\n"
|
| 22 |
+
" - `/help` - Shows this help message."
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
# --- Access Control & Errors ---
|
| 26 |
+
FORCE_SUBSCRIBE_MESSAGE = (
|
| 27 |
+
"β οΈ **Access Denied**\n\n"
|
| 28 |
+
"To use my services, you must be a member of our community channel. This helps us provide a better service.\n\n"
|
| 29 |
+
"Please join π **@{channel_username}** and then send your link again."
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
GROUP_NOT_AUTHORIZED = (
|
| 33 |
+
"β **Service Inactive in this Group**\n\n"
|
| 34 |
+
"I am not authorized to work in this group. If you are a group administrator, please contact my owner ({owner_id}) to request access."
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
USER_BANNED_MESSAGE = "β You have been banned from using this service."
|
| 38 |
+
|
| 39 |
+
GENERIC_ERROR = "β οΈ An unexpected error occurred. The technical team has been notified. Please try again after some time."
|
| 40 |
+
|
| 41 |
+
# --- Job Processing ---
|
| 42 |
+
BATCH_ACKNOWLEDGEMENT = (
|
| 43 |
+
"β
**Request Received!**\n\n"
|
| 44 |
+
"Found {link_count} links. Your job has been queued as **Batch #{batch_id}**.\n"
|
| 45 |
+
"I will now evaluate the links..."
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
BATCH_UPDATE_VALIDATED = (
|
| 49 |
+
"βοΈ **Processing Batch #{batch_id}**\n\n"
|
| 50 |
+
"**Status:** {valid_count} out of {total_count} links are valid and are being processed.\n"
|
| 51 |
+
"({skipped_count} link(s) were skipped).\n\n"
|
| 52 |
+
"**Progress:** {progress_bar} {processed_count}/{valid_count}"
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
BATCH_CANCELLED = "β **Batch #{batch_id}** has been successfully cancelled by the user."
|
| 56 |
+
|
| 57 |
+
BATCH_COMPLETE_SUMMARY = (
|
| 58 |
+
"β
**Batch #{batch_id} Complete!**\n\n"
|
| 59 |
+
"**Summary:**\n"
|
| 60 |
+
" - **Successful:** {success_count} files sent to your DM.\n"
|
| 61 |
+
" - **Skipped:** {skipped_count} links.\n\n"
|
| 62 |
+
"**Details of Skipped/Failed Links:**\n{failed_details}"
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
BATCH_COMPLETE_NO_SKIPS = (
|
| 66 |
+
"β
**Batch #{batch_id} Complete!**\n\n"
|
| 67 |
+
"All **{success_count} files** have been successfully processed and sent to your DM."
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
DELIVERY_PROMPT_IN_GROUP = "β
@{username}, your file(s) from **Batch #{batch_id}** are being sent to your private chat (DM)."
|
| 71 |
+
|
| 72 |
+
START_BOT_IN_DM_PROMPT = "β οΈ To receive your files, you need to start a conversation with me first. Please click the button below and press 'START'."
|
| 73 |
+
|
| 74 |
+
# --- Monetization & User Account ---
|
| 75 |
+
PREMIUM_REQUIRED_ERROR = (
|
| 76 |
+
"β **Premium Plan Required**\n\n"
|
| 77 |
+
"The file `{file_name}` is **{file_size}**, which is larger than your free user limit of **{free_limit}**.\n\n"
|
| 78 |
+
"Check /myaccount for upgrade options."
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
MY_ACCOUNT_FREE = (
|
| 82 |
+
"π€ **My Account**\n\n"
|
| 83 |
+
"**User ID:** `{user_id}`\n"
|
| 84 |
+
"**Current Plan:** Free User\n\n"
|
| 85 |
+
"**Your Benefits:**\n"
|
| 86 |
+
" - Download new files up to **{free_limit}**.\n"
|
| 87 |
+
" - Unlimited downloads for any file already in our cache.\n\n"
|
| 88 |
+
"*Contact my owner ({owner_id}) for information on premium plans.*"
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
MY_ACCOUNT_PREMIUM = (
|
| 92 |
+
"π€ **My Account**\n\n"
|
| 93 |
+
"**User ID:** `{user_id}`\n"
|
| 94 |
+
"**Current Plan:** β **Premium**\n"
|
| 95 |
+
"**Subscription Expires:** {expiry_date}\n\n"
|
| 96 |
+
"Thank you for your support! π"
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
# --- Final File Caption ---
|
| 100 |
+
FILE_CAPTION = (
|
| 101 |
+
"**{file_name}**\n\n"
|
| 102 |
+
"π¦ **Size:** {file_size}\n"
|
| 103 |
+
"π **Source:** `{source_url}`\n\n"
|
| 104 |
+
"Powered by @YourBotUsername" # Replace with your bot's username
|
| 105 |
+
)
|
| 106 |
+
|
| 107 |
+
# --- Admin Confirmation Messages ---
|
| 108 |
+
ADMIN_PREMIUM_GRANTED = "β
Success! User `{user_id}` has been granted premium access for **{duration}**."
|
| 109 |
+
ADMIN_TIME_ADJUSTED = "β
Success! Subscription for user `{user_id}` has been adjusted by **{duration}**."
|
| 110 |
+
ADMIN_USER_BANNED = "β
Success! User `{user_id}` has been banned."
|
| 111 |
+
ADMIN_USER_UNBANNED = "β
Success! User `{user_id}` has been unbanned."
|
| 112 |
+
ADMIN_GROUP_AUTH = "β
Success! Group `{group_id}` is now authorized."
|
| 113 |
+
ADMIN_GROUP_DEAUTH = "β
Success! Group `{group_id}` has been de-authorized."
|
| 114 |
+
ADMIN_BROADCAST_START = "π’ **Broadcast Started...** Sending message to all users. This may take some time."
|
| 115 |
+
ADMIN_BROADCAST_COMPLETE = "β
**Broadcast Complete!** Message sent to **{user_count}** users."
|