1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

skip_updates

This commit is contained in:
_run
2021-08-15 11:40:13 +04:00
parent 5b942a5b31
commit beeb60aab8
2 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,15 @@
import telebot
bot = telebot.TeleBot("TOKEN")
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda message: True)
def echo_all(message):
bot.reply_to(message, message.text)
bot.polling(skip_updates=True) # Will skip old messages when skip_updates is set
# Also, you can use skip_updates in infinity_polling()