Skip to content

Instantly share code, notes, and snippets.

@Smosker Smosker/
Last active May 11, 2016

What would you like to do?
import time
import telepot
from telepot.namedtuple import ReplyKeyboardMarkup,InlineKeyboardMarkup,InlineKeyboardButton
TOKEN = 'Put your token here'
previous_message = {}
def handle(msg):
info = telepot.glance(msg)
if msg['text'] =='/start':
message = '''press on button below to see if bug working'''
show_keyboard = ReplyKeyboardMarkup(keyboard=[['Press me']])
bot.sendMessage(info[2], message, reply_markup=show_keyboard,
if msg['text'] == 'Press me':
if previous_message.get(info[2],None):
msgid = (info[2], previous_message[info[2]]['message_id'])
message = ''
markup_keyboard = InlineKeyboardMarkup(inline_keyboard=
[[InlineKeyboardButton(text='Dont press me just click on "Press me" below again',
previous_message[info[2]]=bot.sendMessage(info[2], message, reply_markup=markup_keyboard,disable_web_page_preview=True)
bot = telepot.Bot(TOKEN)
answerer = telepot.helper.Answerer(bot)
bot.message_loop({'chat': handle,
'callback_query': None,
'inline_query': None,
'chosen_inline_result': None})
while 1:

This comment has been minimized.

Copy link
Owner Author

Smosker commented May 11, 2016

Problem - when sendind new message with inline keyboard i want get rid of inline keyboard in previous message with it, so i use method "editMessageReplyMarkup" passing it user id amd message id - and it works normal but problem is that it seems to turn off setting "disable_web_page_preview=True" in this message (which keyboard i edit)

Video web version -
Video desctop mac -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.