Minor Changes

This commit is contained in:
Avi Patil
2024-01-06 15:16:14 +05:30
parent 61b7dac2b7
commit 7b35887bc3
18 changed files with 306 additions and 285 deletions

View File

@@ -20,12 +20,20 @@ async def start(bot: Client, message: Message):
usr_cmd = message.text.split("_")[-1]
if usr_cmd == "/start":
await message.reply_text(
text=LANG.START_TEXT.format(message.from_user.mention, FileStream.username),
parse_mode=ParseMode.HTML,
disable_web_page_preview=True,
reply_markup=BUTTON.START_BUTTONS
)
if Telegram.START_PIC:
await message.reply_photo(
photo=Telegram.START_PIC,
caption=LANG.START_TEXT.format(message.from_user.mention, FileStream.username),
parse_mode=ParseMode.HTML,
reply_markup=BUTTON.START_BUTTONS
)
else:
await message.reply_text(
text=LANG.START_TEXT.format(message.from_user.mention, FileStream.username),
parse_mode=ParseMode.HTML,
disable_web_page_preview=True,
reply_markup=BUTTON.START_BUTTONS
)
else:
if "stream_" in message.text:
try:
@@ -70,23 +78,38 @@ async def start(bot: Client, message: Message):
async def start(bot, message):
if not await verify_user(bot, message):
return
await message.reply_text(
text=LANG.ABOUT_TEXT.format(FileStream.fname, __version__),
disable_web_page_preview=True,
reply_markup=BUTTON.ABOUT_BUTTONS
)
if Telegram.START_PIC:
await message.reply_photo(
photo=Telegram.START_PIC,
caption=LANG.ABOUT_TEXT.format(FileStream.fname, __version__),
parse_mode=ParseMode.HTML,
reply_markup=BUTTON.ABOUT_BUTTONS
)
else:
await message.reply_text(
text=LANG.ABOUT_TEXT.format(FileStream.fname, __version__),
disable_web_page_preview=True,
reply_markup=BUTTON.ABOUT_BUTTONS
)
@FileStream.on_message((filters.command('help')) & filters.private)
async def help_handler(bot, message):
if not await verify_user(bot, message):
return
await message.reply_text(
text=LANG.HELP_TEXT.format(Telegram.OWNER_ID),
parse_mode=ParseMode.HTML,
disable_web_page_preview=True,
reply_markup=BUTTON.HELP_BUTTONS
)
if Telegram.START_PIC:
await message.reply_photo(
photo=Telegram.START_PIC,
caption=LANG.HELP_TEXT.format(Telegram.OWNER_ID),
parse_mode=ParseMode.HTML,
reply_markup=BUTTON.HELP_BUTTONS
)
else:
await message.reply_text(
text=LANG.HELP_TEXT.format(Telegram.OWNER_ID),
parse_mode=ParseMode.HTML,
disable_web_page_preview=True,
reply_markup=BUTTON.HELP_BUTTONS
)
# ---------------------------------------------------------------------------------------------------
@@ -112,7 +135,7 @@ async def my_files(bot: Client, message: Message):
[InlineKeyboardButton("ᴇᴍᴘᴛʏ", callback_data="N/A")],
)
file_list.append([InlineKeyboardButton("ʟsᴇ", callback_data="close")])
await message.reply_photo(photo=Telegram.IMAGE_FILEID,
await message.reply_photo(photo=Telegram.FILE_PIC,
caption="Total files: {}".format(total_files),
reply_markup=InlineKeyboardMarkup(file_list))

View File

@@ -48,8 +48,8 @@ async def private_receive_handler(bot: Client, message: Message):
except FloodWait as e:
print(f"Sleeping for {str(e.value)}s")
await asyncio.sleep(e.value)
await bot.send_message(chat_id=Telegram.LOG_CHANNEL,
text=f"Gᴛ FʟᴅWᴀɪᴛ ᴏғ {str(e.value)}s from [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**𝚄𝚜𝚎𝚛 𝙸𝙳 :** `{str(message.from_user.id)}`",
await bot.send_message(chat_id=Telegram.ULOG_CHANNEL,
text=f"Gᴛ FʟᴅWᴀɪᴛ ᴏғ {str(e.value)}s ғʀᴏᴍ [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**sᴇʀ ɪᴅ :** `{str(message.from_user.id)}`",
disable_web_page_preview=True, parse_mode=ParseMode.MARKDOWN)
@@ -86,10 +86,11 @@ async def channel_receive_handler(bot: Client, message: Message):
except FloodWait as w:
print(f"Sleeping for {str(w.x)}s")
await asyncio.sleep(w.x)
await bot.send_message(chat_id=Telegram.LOG_CHANNEL,
text=f"ɢᴏᴛ ғʟᴏᴏᴅᴡᴀɪᴛ ᴏғ {str(w.x)}s FROM {message.chat.title}\n\n**CHANNEL ID:** `{str(message.chat.id)}`",
await bot.send_message(chat_id=Telegram.ULOG_CHANNEL,
text=f"ɢᴏᴛ ғʟᴏᴏᴅᴡᴀɪᴛ ᴏғ {str(w.x)}s ғʀᴏᴍ {message.chat.title}\n\n**ᴄʜᴀɴɴᴇʟ ɪᴅ :** `{str(message.chat.id)}`",
disable_web_page_preview=True)
except Exception as e:
await bot.send_message(chat_id=Telegram.LOG_CHANNEL, text=f"**#EʀʀʀTʀᴀᴋᴇʙᴀᴋ:** `{e}`",
await bot.send_message(chat_id=Telegram.ULOG_CHANNEL, text=f"**#EʀʀʀTʀᴀᴋᴇʙᴀᴋ:** `{e}`",
disable_web_page_preview=True)
print(f"Cᴀɴ'ᴛ Eᴅɪᴛ Bʀᴀᴅᴀsᴛ Mᴇssᴀɢᴇ!\nEʀʀʀ: **Gɪᴇ ᴍᴇ ᴇᴅɪᴛ ᴘᴇʀᴍɪssɪɴ ɪɴ ᴘᴅᴀᴛᴇs ᴀɴᴅ ʙɪɴ Cʜᴀɴɴᴇʟ!{e}**")