Удалил клавиатуру, сделал отправку приветственной пикчи, обновил библиотеки, добавил логирование

This commit is contained in:
Pavel_Duron 2022-10-29 14:04:56 +10:00
parent 107005c9fe
commit 2ef1bb10fd
2 changed files with 15 additions and 16 deletions

24
bot.py
View File

@ -1,28 +1,22 @@
import time
import logging import logging
from aiogram import Bot, Dispatcher, executor, types from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton
API_TOKEN = '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w' API_TOKEN = '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w'
logging.basicConfig(level=logging.DEBUG) logging.basicConfig(level=logging.DEBUG)
# Initialize bot and dispatcher
bot = Bot(token=API_TOKEN) bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot) dp = Dispatcher(bot)
# @dp.message_handler(commands=['start', 'help'])
# async def send_welcome(message: types.Message):
# await message.reply("Дарова пидорас!")
@dp.message_handler(comands=['start']) @dp.message_handler(commands=['start'])
async def welcome(message: types,Message): async def start_func(message: types.Message)
await message.message('Здравсвуйте! Выберите нужное действие') user_id = message.from_user.id
# далее нужно как-то выставить две кнопки user_full_name = message.from_user.full_name
await message.answer(ReplyKeyboardMarkup logging.INFO(f'{user_id=} {user_full_name=}', {time.asctime()})
(keyboard=[
KeyboardButton(text='тык') await bot.send_photo(inputFile('PYTHON_BOT/ya-pidoras.jpg'))
keyboardButton(text='хуяндок')]
resize_keyboard=True
#какую-то хуйню написал
if __name__ == '__main__': if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True) executor.start_polling(dp, skip_updates=True)

View File

@ -1 +1,6 @@
aiogram time
logging
aiogram
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton