mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Update skip_updates_example.py
This commit is contained in:
parent
2c0f42b363
commit
3e7da0fd18
@ -1,6 +1,6 @@
|
|||||||
import telebot
|
import telebot
|
||||||
|
|
||||||
bot = telebot.TeleBot("TOKEN")
|
bot = telebot.TeleBot("TOKEN",skip_pending=True)# Skip pending skips old updates
|
||||||
|
|
||||||
@bot.message_handler(commands=['start', 'help'])
|
@bot.message_handler(commands=['start', 'help'])
|
||||||
def send_welcome(message):
|
def send_welcome(message):
|
||||||
@ -10,6 +10,4 @@ def send_welcome(message):
|
|||||||
def echo_all(message):
|
def echo_all(message):
|
||||||
bot.reply_to(message, message.text)
|
bot.reply_to(message, message.text)
|
||||||
|
|
||||||
bot.polling(skip_updates=True) # Will skip old messages when skip_updates is set
|
bot.polling()
|
||||||
|
|
||||||
# Also, you can use skip_updates in infinity_polling()
|
|
Loading…
Reference in New Issue
Block a user