Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from vkbottle.bot import Bot, Message
- from vkbottle import Keyboard, KeyboardButtonColor, \
- Text, OpenLink, Location, EMPTY_KEYBOARD
- bot = Bot(token="utoken")
- @bot.on.message(text=['Привет', 'Меню', 'Начать', 'привет', 'меню', 'начать', 'как дела',\
- 'Как дела', 'что ты умеешь', 'Что ты умеешь'])
- @bot.on.message(payload={"cmd": "menu"})
- async def menu_handler(message: Message):
- keyboard = (
- Keyboard(one_time=True)
- .add(Text("Контактная информация учителей", {"cmd": "inf"}), color=KeyboardButtonColor.NEGATIVE)
- .row()
- .add(Text("Подать заявление в школу", {"cmd": "zai"}), color=KeyboardButtonColor.POSITIVE)
- .row()
- .add(Text("Список отсутствующих", {"cmd": "spisok"}), color=KeyboardButtonColor.PRIMARY)
- .row()
- .add(Text("Ошибка", {"cmd": "oshi"}), color=KeyboardButtonColor.NEGATIVE)
- )
- await message.answer("Привет, я бот!\n🔎 Выбери из меню, что ты хочешь узнать.", keyboard=keyboard)
- @bot.on.message(text="Ошибка")
- @bot.on.message(payload={"cmd": "oshi"})
- async def oshi_handler(message: Message):
- keyboard = Keyboard(one_time=True)
- keyboard.add(Text("Назад в меню", {"cmd": "menu"}))
- await message.answer("❌ Это форма для отправки ошибок, багов, проблем, предложений и тд.\n\n\
- ❗ Подробно опиши ошибку, с которой ты столкнулся.\n\
- 👁🗨 Лучше чтобы был скрин", keyboard=keyboard)
- bot.run_forever()
Add Comment
Please, Sign In to add comment