Добавлены примеры и обновлена модель Update
This commit is contained in:
24
examples/echo/main.py
Normal file
24
examples/echo/main.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from maxapi import Bot, Dispatcher
|
||||
from maxapi.filters import F
|
||||
from maxapi.types import MessageCreated
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
bot = Bot('тут_ваш_токен')
|
||||
dp = Dispatcher()
|
||||
|
||||
|
||||
@dp.message_created(F.message.body.text)
|
||||
async def echo(event: MessageCreated):
|
||||
await event.message.answer(f"Повторяю за вами: {event.message.body.text}")
|
||||
|
||||
|
||||
async def main():
|
||||
await dp.start_polling(bot)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(main())
|
Reference in New Issue
Block a user