mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
14 lines
383 B
Python
14 lines
383 B
Python
![]() |
from telebot.async_telebot import AsyncTeleBot
|
||
|
|
||
|
# Update listeners are functions that are called when any update is received.
|
||
|
|
||
|
bot = AsyncTeleBot(token='TOKEN')
|
||
|
|
||
|
async def update_listener(messages):
|
||
|
for message in messages:
|
||
|
if message.text == '/start':
|
||
|
await bot.send_message(message.chat.id, 'Hello!')
|
||
|
|
||
|
bot.set_update_listener(update_listener)
|
||
|
|
||
|
bot.polling()
|