forked from Pavel_Durov/python_bot
добавил команду отправки фото и приветстенное сообщение
This commit is contained in:
parent
fc980aa59a
commit
2b98616ad1
12
bot.py
12
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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user