From 2b98616ad1edcbd318b21e134a6473b11141ea4e Mon Sep 17 00:00:00 2001 From: Pavel_Duron Date: Sun, 30 Oct 2022 20:49:19 +1000 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=83=20=D0=BE=D1=82=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D1=84=D0=BE=D1=82=D0=BE=20?= =?UTF-8?q?=D0=B8=20=D0=BF=D1=80=D0=B8=D0=B2=D0=B5=D1=82=D1=81=D1=82=D0=B5?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE=D0=B5=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 2e131aa..061eba0 100644 --- a/bot.py +++ b/bot.py @@ -3,6 +3,8 @@ import logging from aiogram import Bot, Dispatcher, executor, types from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton +from aiogram.types import FSInputFile + API_TOKEN = '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w' logging.basicConfig(level=logging.DEBUG) @@ -15,9 +17,15 @@ 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('hello') + +@dp.message_handler(commands=['photo']) +async def photo(message: types.Message): + lion = FSInputFile("ya-pidoras.jpg") + await bot.send_photo(lion) + + - await bot.send_photo(types.input_file('PYTHON_BOT/ya-pidoras.jpg')) -#функция вызова пикчи if __name__ == '__main__': executor.start_polling(dp, skip_updates=True)