TheHamkerCat 5 лет назад
Родитель
Сommit
4527a8f3a0
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      wbb/__main__.py

+ 4 - 3
wbb/__main__.py

@@ -130,12 +130,12 @@ async def help_command(_, message):
 
 
 
 
 
 
-async def help_parser(message, keyboard=None):
+async def help_parser(name, keyboard=None):
     if not keyboard:
     if not keyboard:
         keyboard = InlineKeyboardMarkup(paginate_modules(0, HELPABLE, "help"))
         keyboard = InlineKeyboardMarkup(paginate_modules(0, HELPABLE, "help"))
     return (
     return (
         "Hi {first_name}, I am {bot_name}, Here is the list of all possible commands:".format(
         "Hi {first_name}, I am {bot_name}, Here is the list of all possible commands:".format(
-            first_name=message.from_user.first_name,
+            first_name=name,
             bot_name=botinfo.BOT_NAME,
             bot_name=botinfo.BOT_NAME,
         ),
         ),
         keyboard,
         keyboard,
@@ -144,13 +144,14 @@ async def help_parser(message, keyboard=None):
 
 
 @app.on_callback_query(filters.regex("bot_commands"))
 @app.on_callback_query(filters.regex("bot_commands"))
 async def end_callbacc(_, CallbackQuery):
 async def end_callbacc(_, CallbackQuery):
-    text, keyboard = await help_parser(message)
+    text, keyboard = await help_parser(CallbackQuery.from_user.mention)
     await app.send_message(
     await app.send_message(
             CallbackQuery.message.chat.id,
             CallbackQuery.message.chat.id,
             text=text,
             text=text,
             reply_markup=keyboard
             reply_markup=keyboard
             )
             )
 
 
+    await CallbackQuery.message.delete()
 
 
 @app.on_callback_query(filters.regex("stats_callback"))
 @app.on_callback_query(filters.regex("stats_callback"))
 async def end_callbacc(_, CallbackQuery):
 async def end_callbacc(_, CallbackQuery):