pyTelegramBotAPI/examples/asynchronous_telebot/skip_updates_example.py

16 lines
417 B
Python
Raw Normal View History

2021-11-27 21:41:39 +03:00
from telebot.async_telebot import AsyncTeleBot
2021-11-27 23:04:49 +03:00
2021-11-27 21:41:39 +03:00
bot = AsyncTeleBot('TOKEN')
@bot.message_handler(commands=['start', 'help'])
async def send_welcome(message):
await bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda message: True)
async def echo_all(message):
await bot.reply_to(message, message.text)
2021-12-12 13:07:30 +03:00
import asyncio
asyncio.run(bot.polling(skip_pending=True)) # to skip updates