From e1c6bc7cf71001e6d56e8cf74975acc5c790f5ea Mon Sep 17 00:00:00 2001 From: Pavel_Duron Date: Wed, 2 Nov 2022 23:10:27 +1000 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=81=D0=BF=D0=B8=D1=81=D0=BE=D0=BA=20=D0=BA=D0=BE=D0=BC=D0=B0?= =?UTF-8?q?=D0=BD=D0=B4=20=D0=B8=20=D1=80=D0=B5=D0=BF=D0=BB=D0=B0=D0=B9=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=84=D0=BE=D1=82=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index a03a8a4..94b714f 100644 --- a/bot.py +++ b/bot.py @@ -12,16 +12,22 @@ logging.basicConfig(level=logging.DEBUG) bot = Bot(token=API_TOKEN) dp = Dispatcher(bot) +async def set_default_commands(dp): + await dp.bot.set_my_commands([ + types.BotCommand("start", "Запустить бота"), + types.BotCommand("photo", "рандомная пикча"), + ]) # отображает cписок команд + @dp.message_handler(commands=['start']) async def start_func(message: types.Message): # user_id = message.from_user.id # user_full_name = message.from_user.full_name # logging.INFO(f'{user_id=} {user_full_name=}', {time.asctime()}) - await message.reply('hello') + await message.reply('похуй') @dp.message_handler(commands=['photo']) async def send_image(message: types.Message): - await bot.send_photo(message.chat.id, photo='https://memepedia.ru/wp-content/uploads/2018/08/ya-pidoras.jpg') + await bot.send_photo(message.chat.id, photo='https://memepedia.ru/wp-content/uploads/2018/08/ya-pidoras.jpg', reply_to_message_id=message.message_id) @dp.message_handler(content_types=types.ContentTypes.TEXT) async def send_faggot(message: types.Message):