python telegram bot delete message

Solutions on MaxInterview for python telegram bot delete message by the best coders in the world

showing results for - "python telegram bot delete message"
Louison
23 Jan 2018
1# install bot library (in the bash/ commend)
2# $ pip install pyTelegramBotAPI
3
4import telebot #import the library
5
6TOKEN = '<token_string>'
7tb = telebot.TeleBot(TOKEN)	#create a new Telegram Bot object
8
9# Upon calling this function, TeleBot starts polling the Telegram servers for new messages.
10# - none_stop: True/False (default False) - Don't stop polling when receiving an error from the Telegram servers
11# - interval: True/False (default False) - The interval between polling requests
12#           Note: Editing this parameter harms the bot's response time
13# - timeout: integer (default 20) - Timeout in seconds for long polling.
14tb.polling(none_stop=False, interval=0, timeout=20)
15
16tb.delete_message(chat_id, message_id, timeout=None)
17
18
19