fix username not found & message not modified

invalid format and missing variable
This commit is contained in:
levina 2022-02-12 03:26:30 +07:00 committed by GitHub
parent 9620795777
commit 1829674622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,6 +151,7 @@ All commands can be used with (`! / .`) handler""",
@Client.on_callback_query(filters.regex("user_command")) @Client.on_callback_query(filters.regex("user_command"))
async def user_set(_, query: CallbackQuery): async def user_set(_, query: CallbackQuery):
BOT_NAME = (await bot.get_me()).first_name
user_id = query.from_user.id user_id = query.from_user.id
if await is_gbanned_user(user_id): if await is_gbanned_user(user_id):
await query.answer("❗️ You've blocked from using this bot!", show_alert=True) await query.answer("❗️ You've blocked from using this bot!", show_alert=True)
@ -181,6 +182,7 @@ async def user_set(_, query: CallbackQuery):
@Client.on_callback_query(filters.regex("admin_command")) @Client.on_callback_query(filters.regex("admin_command"))
async def admin_set(_, query: CallbackQuery): async def admin_set(_, query: CallbackQuery):
user_id = query.from_user.id user_id = query.from_user.id
BOT_NAME = (await bot.get_me()).first_name
if await is_gbanned_user(user_id): if await is_gbanned_user(user_id):
await query.answer("❗️ You've blocked from using this bot!", show_alert=True) await query.answer("❗️ You've blocked from using this bot!", show_alert=True)
return return
@ -209,6 +211,7 @@ async def admin_set(_, query: CallbackQuery):
@Client.on_callback_query(filters.regex("sudo_command")) @Client.on_callback_query(filters.regex("sudo_command"))
async def sudo_set(_, query: CallbackQuery): async def sudo_set(_, query: CallbackQuery):
user_id = query.from_user.id user_id = query.from_user.id
BOT_NAME = (await bot.get_me()).first_name
if await is_gbanned_user(user_id): if await is_gbanned_user(user_id):
await query.answer("❗️ You've blocked from using this bot!", show_alert=True) await query.answer("❗️ You've blocked from using this bot!", show_alert=True)
return return
@ -239,6 +242,7 @@ async def sudo_set(_, query: CallbackQuery):
@Client.on_callback_query(filters.regex("owner_command")) @Client.on_callback_query(filters.regex("owner_command"))
async def owner_set(_, query: CallbackQuery): async def owner_set(_, query: CallbackQuery):
user_id = query.from_user.id user_id = query.from_user.id
BOT_NAME = (await bot.get_me()).first_name
if await is_gbanned_user(user_id): if await is_gbanned_user(user_id):
await query.answer("❗️ You've blocked from using this bot!", show_alert=True) await query.answer("❗️ You've blocked from using this bot!", show_alert=True)
return return