forked from Pavel_Durov/python_bot
Удалил клавиатуру, сделал отправку приветственной пикчи, обновил библиотеки, добавил логирование
This commit is contained in:
parent
107005c9fe
commit
2ef1bb10fd
22
bot.py
22
bot.py
@ -1,3 +1,4 @@
|
||||
import time
|
||||
import logging
|
||||
|
||||
from aiogram import Bot, Dispatcher, executor, types
|
||||
@ -6,23 +7,16 @@ API_TOKEN = '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w'
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
# Initialize bot and dispatcher
|
||||
bot = Bot(token=API_TOKEN)
|
||||
dp = Dispatcher(bot)
|
||||
# @dp.message_handler(commands=['start', 'help'])
|
||||
# async def send_welcome(message: types.Message):
|
||||
# await message.reply("Дарова пидорас!")
|
||||
|
||||
@dp.message_handler(comands=['start'])
|
||||
async def welcome(message: types,Message):
|
||||
await message.message('Здравсвуйте! Выберите нужное действие')
|
||||
# далее нужно как-то выставить две кнопки
|
||||
await message.answer(ReplyKeyboardMarkup
|
||||
(keyboard=[
|
||||
KeyboardButton(text='тык')
|
||||
keyboardButton(text='хуяндок')]
|
||||
resize_keyboard=True
|
||||
#какую-то хуйню написал
|
||||
@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 bot.send_photo(inputFile('PYTHON_BOT/ya-pidoras.jpg'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
executor.start_polling(dp, skip_updates=True)
|
||||
|
@ -1 +1,6 @@
|
||||
time
|
||||
logging
|
||||
|
||||
aiogram
|
||||
from aiogram import Bot, Dispatcher, executor, types
|
||||
from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton
|
||||
|
Loading…
Reference in New Issue
Block a user