diff --git a/.gitignore b/.gitignore index 876a68d..443a2cc 100644 --- a/.gitignore +++ b/.gitignore @@ -32,8 +32,6 @@ share/python-wheels/ MANIFEST # PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec @@ -88,33 +86,18 @@ profile_default/ ipython_config.py # pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version +.python-version # pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. #Pipfile.lock # poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock +poetry.lock # pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide .pdm.toml -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +# PEP 582 __pypackages__/ # Celery stuff @@ -158,26 +141,14 @@ dmypy.json cython_debug/ # PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ ### Python Patch ### -# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration poetry.toml - -# ruff .ruff_cache/ - -# LSP config files pyrightconfig.json -# End of https://www.toptal.com/developers/gitignore/api/python - -# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) - +### Custom Rules ### logs.txt ssnbot.session ssnbot/ssnbot.session-shm diff --git a/config.ini b/config.ini index 796fcc7..4f76541 100644 --- a/config.ini +++ b/config.ini @@ -31,4 +31,4 @@ args=('logs.txt','w',) [formatter_Formatter] format= [%(asctime)s][%(name)s][%(module)s][%(lineno)d][%(levelname)s] -> %(message)s -datefmt= %d/%m/%Y %H:%M:%S \ No newline at end of file +datefmt= %d/%m/%Y %H:%M:%S diff --git a/data.py b/data.py index f1ab8aa..dc64b02 100644 --- a/data.py +++ b/data.py @@ -2,61 +2,59 @@ class Data: - generate_single_button = [InlineKeyboardButton("🔥 Start Generating Session 🔥", callback_data="generate")] + generate_single_button = InlineKeyboardButton("🦋 ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ 🦋", callback_data="generate") home_buttons = [ - generate_single_button, - [InlineKeyboardButton(text="🏠 Return Home 🏠", callback_data="home")] + [generate_single_button], + [InlineKeyboardButton(text="🧃 ʀᴇᴛᴜʀɴ ʜᴏᴍᴇ 🧃", callback_data="home")] ] - generate_button = [generate_single_button] - buttons = [ - generate_single_button, - [InlineKeyboardButton("✨ Bot Status and More Bots ✨", url="https://t.me/ELUpdates/8")], + [generate_single_button], + [ - InlineKeyboardButton("How to Use ❔", callback_data="help"), - InlineKeyboardButton("🎪 About 🎪", callback_data="about") + InlineKeyboardButton("👻 ʜᴏᴡ ᴛᴏ ᴜꜱᴇ 👻", callback_data="help"), + InlineKeyboardButton("🌲 ᴀʙᴏᴜᴛ 🌲", callback_data="about") ], - [InlineKeyboardButton("♥ More Amazing bots ♥", url="https://t.me/ELUpdates")], + ] START = """ -**Hey {} +**ʜᴇʏ {0}** -Welcome to {} +ᴡᴇʟᴄᴏᴍᴇ ᴛᴏ {1} -If you don't trust this bot, -> Please stop reading this message -> Delete this chat +ɪꜰ ʏᴏᴜ ᴅᴏɴ'ᴛ ᴛʀᴜꜱᴛ ᴛʜɪꜱ ʙᴏᴛ, +> ᴘʟᴇᴀꜱᴇ ꜱᴛᴏᴘ ʀᴇᴀᴅɪɴɢ ᴛʜɪꜱ ᴍᴇꜱꜱᴀɢᴇ +> ᴅᴇʟᴇᴛᴇ ᴛʜɪꜱ ᴄʜᴀᴛ -Still reading? -You can use me to generate Pyrogram and Telethon string session. Use below buttons to learn more ! +ꜱᴛɪʟʟ ʀᴇᴀᴅɪɴɢ? +ʏᴏᴜ ᴄᴀɴ ᴜꜱᴇ ᴍᴇ ᴛᴏ ɢᴇɴᴇʀᴀᴛᴇ ᴘʏʀᴏɢʀᴀᴍ ᴀɴᴅ ᴛᴇʟᴇᴛʜᴏɴ ꜱᴛʀɪɴɢ ꜱᴇꜱꜱɪᴏɴꜱ. ᴜꜱᴇ ᴛʜᴇ ʙᴜᴛᴛᴏɴꜱ ʙᴇʟᴏᴡ ᴛᴏ ʟᴇᴀʀɴ ᴍᴏʀᴇ! -By @ELUpdates** +ʙʏ @The_Architect04** """ HELP = """ -✨ **Available Commands** ✨ - -/about - About The Bot -/help - This Message -/start - Start the Bot -/generate - Generate Session -/cancel - Cancel the process -/restart - Cancel the process +🌴 **ᴀᴠᴀɪʟᴀʙʟᴇ ᴄᴏᴍᴍᴀɴᴅꜱ** 🌴 + +/about - ᴀʙᴏᴜᴛ ᴛʜᴇ ʙᴏᴛ +/help - ᴛʜɪꜱ ᴍᴇꜱꜱᴀɢᴇ +/start - ꜱᴛᴀʀᴛ ᴛʜᴇ ʙᴏᴛ +/generate - ɢᴇɴᴇʀᴀᴛᴇ ꜱᴇꜱꜱɪᴏɴ +/cancel - ᴄᴀɴᴄᴇʟ ᴛʜᴇ ᴘʀᴏᴄᴇꜱꜱ +/restart - ᴄᴀɴᴄᴇʟ ᴀɴᴅ ʀᴇꜱᴛᴀʀᴛ ᴛʜᴇ ᴘʀᴏᴄᴇꜱꜱ """ ABOUT = """ -**About This Bot** +🍄 **ᴀʙᴏᴜᴛ ᴛʜɪꜱ ʙᴏᴛ** 🍄 -Telegram Bot to generate Pyrogram and Telethon string session by @ELUpdates +ᴛᴇʟᴇɢʀᴀᴍ ʙᴏᴛ ᴛᴏ ɢᴇɴᴇʀᴀᴛᴇ ᴘʏʀᴏɢʀᴀᴍ ᴀɴᴅ ᴛᴇʟᴇᴛʜᴏɴ ꜱᴛʀɪɴɢ ꜱᴇꜱꜱɪᴏɴꜱ ʙʏ @The_Architect04 -Source Code : [Click Here](https://github.com/EL-Coders/SessionStringBot) +ꜱᴏᴜʀᴄᴇ ᴄᴏᴅᴇ: [ᴄʟɪᴄᴋ ʜᴇʀᴇ](https://github.com/) -Framework : [Pyrogram](https://docs.pyrogram.org) +ꜰʀᴀᴍᴇᴡᴏʀᴋ: [ᴘʏʀᴏɢʀᴀᴍ](https://docs.pyrogram.org) -Language : [Python](https://www.python.org) +ʟᴀɴɢᴜᴀɢᴇ: [ᴘʏᴛʜᴏɴ](https://www.python.org) -Developer : @CoderELAlpha +ᴅᴇᴠᴇʟᴏᴘᴇʀ: @Marwin_ll """ diff --git a/requirements.txt b/requirements.txt index 892f531..6a66a09 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,9 @@ -python-dotenv -SQLAlchemy -psycopg2 -Telethon -git+https://github.com/rahulps1000/pyropatch.git@pyrotgfork -pyrotgfork -TgCrypto -uvloop +python-dotenv # For environment variable management +SQLAlchemy # For database ORM +psycopg2-binary # PostgreSQL database adapter +Telethon # Telegram client library +git+https://github.com/rahulps1000/pyropatch.git@pyrotgfork # Custom Pyrogram patch fork +TgCrypto # Cryptographic library for Telegram +uvloop # Fast asyncio event loop +python-3.11.4 + diff --git a/runtime.txt b/runtime.txt index 3338e5c..431fc7e 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.10.4 \ No newline at end of file +python-3.11.4 diff --git a/.env.sample b/sample.env similarity index 100% rename from .env.sample rename to sample.env diff --git a/ssnbot/__init__.py b/ssnbot/__init__.py index 7509aab..94b3191 100644 --- a/ssnbot/__init__.py +++ b/ssnbot/__init__.py @@ -24,4 +24,4 @@ # logging Conf logging.config.fileConfig(fname='config.ini', disable_existing_loggers=False) LOGGER = logging.getLogger(__name__) -logging.getLogger("pyrogram").setLevel(logging.WARNING) \ No newline at end of file +logging.getLogger("pyrogram").setLevel(logging.WARNING) diff --git a/ssnbot/db/sql.py b/ssnbot/db/sql.py index f18c666..d84ce22 100644 --- a/ssnbot/db/sql.py +++ b/ssnbot/db/sql.py @@ -6,6 +6,21 @@ from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.pool import StaticPool from ssnbot import DB_URL +from sqlalchemy import create_engine + +# Connection URL +connection_url = "postgresql://neondb_owner:ji43CdTZBIPX@ep-broad-lake-a88oaxik.eastus2.azure.neon.tech/neondb?sslmode=require" + +# Create an engine +engine = create_engine(connection_url) + +# Connect to the database and perform a query +with engine.connect() as connection: + result = connection.execute("SELECT table_name FROM information_schema.tables WHERE table_schema='public';") + + print("Tables in the database:") + for row in result: + print(row[0]) BASE = declarative_base() @@ -68,4 +83,4 @@ async def del_user(user_id): SESSION.commit() except NoResultFound: pass - \ No newline at end of file + diff --git a/ssnbot/plugins/basic.py b/ssnbot/plugins/basic.py index 3ac539a..c6f2b4e 100644 --- a/ssnbot/plugins/basic.py +++ b/ssnbot/plugins/basic.py @@ -1,47 +1,78 @@ from data import Data from pyrogram import Client, filters -from pyrogram.types import InlineKeyboardMarkup, Message, LinkPreviewOptions -from ssnbot.db.sql import add_user, query_msg +from pyrogram.types import InlineKeyboardMarkup, Message +from ssnbot.db.sql import add_user -def filter(cmd: str): +def command_filter(cmd: str): + """Custom filter for handling bot commands.""" return filters.private & filters.incoming & filters.command(cmd) # Start Message -@Client.on_message(filter("start")) +@Client.on_message(command_filter("start")) async def start(bot: Client, msg: Message): - id = msg.from_user.id - user_name = '@' + msg.from_user.username if msg.from_user.username else None - await add_user(id, user_name) - user = await bot.get_me() - mention = user.mention - await bot.send_message( - msg.chat.id, - Data.START.format(msg.from_user.mention, mention), - reply_markup=InlineKeyboardMarkup(Data.buttons) - ) + """ + Handles the /start command. Greets the user and stores their information in the database. + """ + user_id = msg.from_user.id + username = f"@{msg.from_user.username}" if msg.from_user.username else "Anonymous" + + try: + # Add the user to the database + await add_user(user_id, username) + except Exception as e: + print(f"Error adding user to database: {e}") + + bot_user = await bot.get_me() + mention = bot_user.mention + + try: + await bot.send_message( + msg.chat.id, + Data.START.format(msg.from_user.mention, mention), + reply_markup=InlineKeyboardMarkup(Data.buttons) + ) + except Exception as e: + print(f"Error sending start message: {e}") # Help Message -@Client.on_message(filter("help")) -async def _help(bot: Client, msg: Message): - id = msg.from_user.id - user_name = '@' + msg.from_user.username if msg.from_user.username else None - await add_user(id, user_name) - await bot.send_message( - msg.chat.id, Data.HELP, - reply_markup=InlineKeyboardMarkup(Data.home_buttons) - ) +@Client.on_message(command_filter("help")) +async def help_command(bot: Client, msg: Message): + """ + Handles the /help command. Provides usage instructions to the user. + """ + user_id = msg.from_user.id + username = f"@{msg.from_user.username}" if msg.from_user.username else "Anonymous" + + try: + await add_user(user_id, username) + except Exception as e: + print(f"Error adding user to database: {e}") + + try: + await bot.send_message( + msg.chat.id, + Data.HELP, + reply_markup=InlineKeyboardMarkup(Data.home_buttons) + ) + except Exception as e: + print(f"Error sending help message: {e}") # About Message -@Client.on_message(filter("about")) +@Client.on_message(command_filter("about")) async def about(bot: Client, msg: Message): - await bot.send_message( - msg.chat.id, - Data.ABOUT, - # disable_web_page_preview=True, - link_preview_options=LinkPreviewOptions(is_disabled=True), - reply_markup=InlineKeyboardMarkup(Data.home_buttons), - ) + """ + Handles the /about command. Provides information about the bot. + """ + try: + await bot.send_message( + msg.chat.id, + Data.ABOUT, + disable_web_page_preview=True, + reply_markup=InlineKeyboardMarkup(Data.home_buttons) + ) + except Exception as e: + print(f"Error sending about message: {e}") diff --git a/ssnbot/plugins/broadcast.py b/ssnbot/plugins/broadcast.py index 9ec758d..2f6a9d2 100644 --- a/ssnbot/plugins/broadcast.py +++ b/ssnbot/plugins/broadcast.py @@ -48,3 +48,4 @@ async def send_text(bot, message: Message): msg = await message.reply_text(reply_error, message.id) await asyncio.sleep(8) await msg.delete() + diff --git a/ssnbot/plugins/callbacks.py b/ssnbot/plugins/callbacks.py index 83279fd..3f5dae2 100644 --- a/ssnbot/plugins/callbacks.py +++ b/ssnbot/plugins/callbacks.py @@ -1,10 +1,16 @@ import traceback from data import Data from pyrogram import Client, filters -from pyrogram.types import InlineKeyboardMarkup, LinkPreviewOptions +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, LinkPreviewOptions from ssnbot.plugins.generate import generate_session, ask_ques, buttons_ques from ssnbot import LOGGER +ERROR_MESSAGE = ( + "Oops! An exception occurred! \n\n**Error** : {} " + "\n\nPlease visit @The_Architect04 if this message doesn't contain any " + "sensitive information and you want to report this issue, " + "as this error message is not being logged by us!" +) @Client.on_callback_query(filters.regex(r"^home$")) async def home(bot, query): @@ -16,7 +22,7 @@ async def home(bot, query): chat_id=chat_id, message_id=message_id, text=Data.START.format(query.from_user.mention, mention), - reply_markup=InlineKeyboardMarkup(Data.buttons), + reply_markup=InlineKeyboardMarkup(Data.buttons), # Ensure Data.buttons exists ) @@ -27,10 +33,9 @@ async def about(bot, query): await bot.edit_message_text( chat_id=chat_id, message_id=message_id, - text=Data.ABOUT, - # disable_web_page_preview=True, + text=Data.ABOUT, # Ensure Data.ABOUT exists link_preview_options=LinkPreviewOptions(is_disabled=True), - reply_markup=InlineKeyboardMarkup(Data.home_buttons), + reply_markup=InlineKeyboardMarkup(Data.home_buttons), # Ensure Data.home_buttons exists ) @@ -41,10 +46,9 @@ async def help(bot, query): await bot.edit_message_text( chat_id=chat_id, message_id=message_id, - text=Data.HELP, - # disable_web_page_preview=True, + text=Data.HELP, # Ensure Data.HELP exists link_preview_options=LinkPreviewOptions(is_disabled=True), - reply_markup=InlineKeyboardMarkup(Data.home_buttons), + reply_markup=InlineKeyboardMarkup(Data.home_buttons), # Ensure Data.home_buttons exists ) @@ -61,7 +65,7 @@ async def pyro(bot, query): "Please note that the new type of string sessions may not work in all bots, i.e, only the bots that have been updated to pyrogram v2 will work!", show_alert=True, ) - await generate_session(bot, query.message) + await generate_session(bot, query.message) # Ensure generate_session is correct except Exception as e: LOGGER.error(traceback.format_exc()) LOGGER.error(e) @@ -72,16 +76,8 @@ async def pyro(bot, query): async def tele(bot, query): try: await query.answer() - await generate_session(bot, query.message, telethon=True) + await generate_session(bot, query.message, telethon=True) # Ensure generate_session handles Telethon except Exception as e: LOGGER.error(traceback.format_exc()) LOGGER.error(e) await query.message.reply(ERROR_MESSAGE.format(str(e))) - - -ERROR_MESSAGE = ( - "Oops! An exception occurred! \n\n**Error** : {} " - "\n\nPlease visit @ElUpdates if this message doesn't contain any " - "sensitive information and you if want to report this as " - "this error message is not being logged by us!" -) diff --git a/ssnbot/plugins/generate.py b/ssnbot/plugins/generate.py index 4900955..ae12789 100644 --- a/ssnbot/plugins/generate.py +++ b/ssnbot/plugins/generate.py @@ -28,11 +28,11 @@ from data import Data from ssnbot import LOGGER -ask_ques = "Please choose the python library you want to generate string session for" +ask_ques = "ᴘʟᴇᴀꜱᴇ ᴄʜᴏᴏꜱᴇ ᴛʜᴇ ᴘʏᴛʜᴏɴ ʟɪʙʀᴀʀʏ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ɢᴇɴᴇʀᴀᴛᴇ ꜱᴛʀɪɴɢ ꜱᴇꜱꜱɪᴏɴ ꜰᴏʀ 🤖" buttons_ques = [ [ - InlineKeyboardButton("Pyrogram", callback_data="pyrogram"), - InlineKeyboardButton("Telethon", callback_data="telethon"), + InlineKeyboardButton("🍷ᴘʏʀᴏɢʀᴀᴍ🍷", callback_data="pyrogram"), + InlineKeyboardButton("🍧ᴛᴇʟᴇᴛʜᴏɴ🍧", callback_data="telethon"), ], ] @@ -55,7 +55,7 @@ async def generate_session( ty = "Pyrogram" if is_bot: ty += " Bot" - await msg.reply(f"Starting {ty} Session Generation...") + await msg.reply(f"ꜱᴛᴀʀᴛɪɴɢ {ty} ꜱᴇꜱꜱɪᴏɴ ɢᴇɴᴇʀᴀᴛɪᴏɴ🪺...") user_id = msg.chat.id try: @@ -63,7 +63,7 @@ async def generate_session( user_id, "Please send your `API_ID`", filters=filters.text, timeout=360 ) except TimeoutError: - await msg.reply_text("Request timed out, please try again with /start") + await msg.reply_text("ʀᴇQᴜᴇꜱᴛ ᴛɪᴍᴇᴅ ᴏᴜᴛ, ᴘʟᴇᴀꜱᴇ ᴛʀʏ ᴀɢᴀɪɴ ᴡɪᴛʜ /start") return if await cancelled(api_id_msg): @@ -73,7 +73,7 @@ async def generate_session( api_id = int(api_id_msg.text) except ValueError: await api_id_msg.reply( - "Not a valid API_ID (which must be an integer). Please start generating session again.", + "Not a valid API_ID (which must be an integer). ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ🌱.", quote=True, reply_markup=InlineKeyboardMarkup(Data.generate_button), ) @@ -81,33 +81,33 @@ async def generate_session( try: api_hash_msg = await bot.ask_message( - user_id, "Please send your `API_HASH`", filters=filters.text, timeout=360 + user_id, "ᴘʟᴇᴀꜱᴇ ꜱᴇɴᴅ ʏᴏᴜʀ `API_HASH`", filters=filters.text, timeout=360 ) except TimeoutError: - await msg.reply_text("Request timed out, please try again with /start") + await msg.reply_text("ʀᴇQᴜᴇꜱᴛ ᴛɪᴍᴇᴅ ᴏᴜᴛ, ᴘʟᴇᴀꜱᴇ ᴛʀʏ ᴀɢᴀɪɴ ᴡɪᴛʜ /start") return if await cancelled(api_hash_msg): return api_hash = api_hash_msg.text if not is_bot: - t = "Now please send your `PHONE_NUMBER` along with the country code. \nExample : `+19876543210`'" + t = "ɴᴏᴡ ᴘʟᴇᴀꜱᴇ ꜱᴇɴᴅ ʏᴏᴜʀ `PHONE_NUMBER` ᴀʟᴏɴɢ ᴡɪᴛʜ ᴛʜᴇ ᴄᴏᴜɴᴛʀʏ ᴄᴏᴅᴇ⚡ \nᴇxᴀᴍᴘʟᴇ : `+19876543210`'" else: - t = "Now please send your `BOT_TOKEN` \nExample : `12345:abcdefghijklmnopqrstuvwxyz`'" + t = "ɴᴏᴡ ᴘʟᴇᴀꜱᴇ ꜱᴇɴᴅ ʏᴏᴜʀ `BOT_TOKEN` \nᴇxᴀᴍᴘʟᴇ : `12345:abcdefghijklmnopqrstuvwxyz`'" try: phone_number_msg = await bot.ask_message( user_id, t, filters=filters.text, timeout=360 ) except TimeoutError: - await msg.reply_text("Request timed out, please try again with /start") + await msg.reply_text("ʀᴇQᴜᴇꜱᴛ ᴛɪᴍᴇᴅ ᴏᴜᴛ, ᴘʟᴇᴀꜱᴇ ᴛʀʏ ᴀɢᴀɪɴ /start") return if await cancelled(phone_number_msg): return phone_number = phone_number_msg.text - await msg.reply("Sending OTP...") + await msg.reply("ꜱᴇɴᴅɪɴɢ ᴏᴛᴘ👀...") if telethon and is_bot: clientt = TelegramClient(StringSession(), api_id, api_hash) @@ -141,22 +141,22 @@ async def generate_session( code = await clientt.send_code(phone_number) except (ApiIdInvalid, ApiIdInvalidError): await msg.reply( - "`API_ID` and `API_HASH` combination is invalid. Please start generating session again.", + "`API_ID` and `API_HASH` ᴄᴏᴍʙɪɴᴀᴛɪᴏɴ ɪꜱ ɪɴᴠᴀʟɪᴅ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ😶.", reply_markup=InlineKeyboardMarkup(Data.generate_button), ) return except (PhoneNumberInvalid, PhoneNumberInvalidError): await msg.reply( - "`PHONE_NUMBER` is invalid. Please start generating session again.", + "`PHONE_NUMBER` ɪꜱ ɪɴᴠᴀʟɪᴅ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ💤.", reply_markup=InlineKeyboardMarkup(Data.generate_button), ) return except PhoneNumberBanned: - await msg.reply("`PHONE_NUMBER` is banned, please try with another number.") + await msg.reply("`PHONE_NUMBER` ɪꜱ ʙᴀɴɴᴇᴅ, ᴘʟᴇᴀꜱᴇ ᴛʀʏ ᴡɪᴛʜ ᴀɴᴏᴛʜᴇʀ ɴᴜᴍʙᴇʀ🌪️") return except PhonePasswordFlood: await msg.reply( - "Unable to send code, you have tried logging in too many times." + "ᴜɴᴀʙʟᴇ ᴛᴏ ꜱᴇɴᴅ ᴄᴏᴅᴇ, ʏᴏᴜ ʜᴀᴠᴇ ᴛʀɪᴇᴅ ʟᴏɢɢɪɴɢ ɪɴ ᴛᴏᴏ ᴍᴀɴʏ ᴛɪᴍᴇꜱ🍩" ) return @@ -165,7 +165,7 @@ async def generate_session( if not is_bot: phone_code_msg = await bot.ask_message( user_id, - "Please check for an OTP in official telegram account. If you got it, send OTP here after reading the below format. \nIf OTP is `12345`, **please send it as** `1 2 3 4 5`.", + "ᴘʟᴇᴀꜱᴇ ᴄʜᴇᴄᴋ ꜰᴏʀ ᴀɴ ᴏᴛᴘ ɪɴ ᴏꜰꜰɪᴄɪᴀʟ ᴛᴇʟᴇɢʀᴀᴍ ᴀᴄᴄᴏᴜɴᴛ. ɪꜰ ʏᴏᴜ ɢᴏᴛ ɪᴛ, ꜱᴇɴᴅ ᴏᴛᴘ ʜᴇʀᴇ ᴀꜰᴛᴇʀ ʀᴇᴀᴅɪɴɢ ᴛʜᴇ ʙᴇʟᴏᴡ ꜰᴏʀᴍᴀᴛ🍿 \nɪꜰ ᴏᴛᴘ ɪꜱ `12345`, **ᴘʟᴇᴀꜱᴇ ꜱᴇɴᴅ ɪᴛ ᴀꜱ** `1 2 3 4 5`.", filters=filters.text, timeout=360, ) @@ -173,7 +173,7 @@ async def generate_session( return except TimeoutError: await msg.reply( - "Time limit reached of 5 minutes. Please start generating session again by tapping /start.", + "ᴛɪᴍᴇ ʟɪᴍɪᴛ ʀᴇᴀᴄʜᴇᴅ ᴏꜰ 5 ᴍɪɴᴜᴛᴇꜱ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ ʙʏ ᴛᴀᴘᴘɪɴɢ😸 /start.", reply_markup=InlineKeyboardMarkup(Data.generate_button), ) return @@ -187,13 +187,13 @@ async def generate_session( await clientt.sign_in(phone_number, code.phone_code_hash, phone_code) except (PhoneCodeInvalid, PhoneCodeInvalidError): await msg.reply( - "OTP is invalid. Please start generating session again.", + "ᴏᴛᴘ ɪꜱ ɪɴᴠᴀʟɪᴅ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ🌴", reply_markup=InlineKeyboardMarkup(Data.generate_button), ) return except (PhoneCodeExpired, PhoneCodeExpiredError): await msg.reply( - "OTP is expired. Please start generating session again.", + "ᴏᴛᴘ ɪꜱ ᴇxᴘɪʀᴇᴅ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ🍬", reply_markup=InlineKeyboardMarkup(Data.generate_button), ) return @@ -204,13 +204,13 @@ async def generate_session( try: two_step_msg = await bot.ask_message( user_id, - "Your account has enabled two-step verification. Please provide the password.", + "ʏᴏᴜʀ ᴀᴄᴄᴏᴜɴᴛ ʜᴀꜱ ᴇɴᴀʙʟᴇᴅ ᴛᴡᴏ-ꜱᴛᴇᴘ ᴠᴇʀɪꜰɪᴄᴀᴛɪᴏɴ. ᴘʟᴇᴀꜱᴇ ᴘʀᴏᴠɪᴅᴇ ᴛʜᴇ ᴘᴀꜱꜱᴡᴏʀᴅ🙈", filters=filters.text, timeout=300, ) except TimeoutError: await msg.reply( - "Time limit reached of 5 minutes. Please start generating session again by tapping /start.", + "ᴛɪᴍᴇ ʟɪᴍɪᴛ ʀᴇᴀᴄʜᴇᴅ ᴏꜰ 5 ᴍɪɴᴜᴛᴇꜱ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ ʙʏ ᴛᴀᴘᴘɪɴɢ /start.", reply_markup=InlineKeyboardMarkup(Data.generate_button), ) return @@ -227,7 +227,7 @@ async def generate_session( PasswordHashInvalidError, ): await two_step_msg.reply( - "Invalid Password Provided. Please start generating session again.", + "ɪɴᴠᴀʟɪᴅ ᴘᴀꜱꜱᴡᴏʀᴅ ᴘʀᴏᴠɪᴅᴇᴅ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ🫧", quote=True, reply_markup=InlineKeyboardMarkup(Data.generate_button), ) @@ -240,7 +240,7 @@ async def generate_session( await clientt.sign_in_bot(phone_number) except (AccessTokenInvalid, AccessTokenInvalidError): await msg.reply( - "`BOT_TOKEN` is invalid. Please start generating session again.", + "`BOT_TOKEN` ɪꜱ ɪɴᴠᴀʟɪᴅ. ᴘʟᴇᴀꜱᴇ ꜱᴛᴀʀᴛ ɢᴇɴᴇʀᴀᴛɪɴɢ ꜱᴇꜱꜱɪᴏɴ ᴀɢᴀɪɴ🙁", reply_markup=InlineKeyboardMarkup(Data.generate_button), ) return @@ -253,7 +253,7 @@ async def generate_session( except Exception as e: LOGGER.error(e) - text = f"**{ty.upper()} STRING SESSION** \n\n`{string_session}` \n\nGenerated by @SessionStringzBot" + text = f"**{ty.upper()} STRING SESSION** \n\n`{string_session}` \n\nɢᴇɴᴇʀᴀᴛᴇᴅ ʙʏ @The_Architect04" try: if not is_bot: await clientt.send_message("me", text) @@ -269,7 +269,7 @@ async def generate_session( await bot.send_message( msg.chat.id, - "Successfully generated {} string session. \n\nPlease check your saved messages! \n\nBy @ELUpdates".format( + "ꜱᴜᴄᴄᴇꜱꜱꜰᴜʟʟʏ ɢᴇɴᴇʀᴀᴛᴇᴅ {} ꜱᴛʀɪɴɢ ꜱᴇꜱꜱɪᴏɴ. \n\nᴘʟᴇᴀꜱᴇ ᴄʜᴇᴄᴋ ʏᴏᴜʀ ꜱᴀᴠᴇᴅ ᴍᴇꜱꜱᴀɢᴇꜱ🍫 \n\nʙʏ @The_Architect04".format( "telethon" if telethon else "pyrogram" ), ) diff --git a/ssnbot/plugins/must_join.py b/ssnbot/plugins/must_join.py index ca50a3e..5c99fe1 100644 --- a/ssnbot/plugins/must_join.py +++ b/ssnbot/plugins/must_join.py @@ -19,11 +19,11 @@ async def must_join_channel(bot: Client, msg: Message): link = chat_info.invite_link try: await msg.reply( - f"You must join [this channel]({link}) to use me. After joining try again !", + f"ᴛᴏ ᴜᴛɪʟɪᴢᴇ ᴍʏ ꜱᴇʀᴠɪᴄᴇꜱ, ᴘʟᴇᴀꜱᴇ ᴊᴏɪɴ [ᴛʜɪꜱ ᴄʜᴀɴɴᴇʟ]({link}) ꜰɪʀꜱᴛ. ᴛʜᴇɴ ʏᴏᴜ ᴄᴀɴ ᴀᴛᴛᴇᴍᴘᴛ ᴀɢᴀɪɴ 🧑‍💻", # disable_web_page_preview=True, link_preview_options=LinkPreviewOptions(is_disabled=True), reply_markup=InlineKeyboardMarkup([ - [InlineKeyboardButton("✨ Join Channel ✨", url=link)] + [InlineKeyboardButton("❤️‍🩹 ᴊᴏɪɴ ᴄʜᴀɴɴᴇʟ ❤️‍🩹", url=link)] ]) ) await msg.stop_propagation()