Answer the question
In order to leave comments, you need to log in
How to update the keyboard in telegram bot?
Added a couple of new features to the keyboard, but it will be updated if the user writes / start again, which, in fact, is unlikely to be done. How to ensure that the keyboard is updated for all users? Maybe there is someone who has experienced this. Thanks in advance! Here is the code:
import telebot
bot = telebot.TeleBot("---")
keyboard = telebot.types.ReplyKeyboardMarkup(True)
keyboard.row('---')
keyboard.row('---')
keyboard.row('---')
keyboard.row('---')
keyboard.row('---')
---="---"
def send(id,text):
bot.send_message(id, text, reply_markup = keyboard)
@bot.message_handler(commands=['start'])
def answer(message):
send(message.chat.id, "---")
send(message.chat.id, "---")
@bot.message_handler(content_types=['text'])
def main(message):
id = message.chat.id
msg = message.text
if msg == "---":
p = open("---.jpg", 'rb')
bot.send_photo(id, p)
elif msg == "---":
bot.send_message(id, "---")
elif msg == "---":
r = open("---.jpg", 'rb')
bot.send_photo(id, r)
elif msg == "---":
bot.send_message(id, ---)
elif msg == "Связь со мной":
bot.send_message(id,'--- ---' )
elif msg == "---":
bot.send_message(id, "---")
m = open("---",'rb')
bot.send_document(id, m)
elif msg == "---":
bot.send_message(id, "---")
u = open("---.docx", 'rb')
bot.send_document(id, u)
elif msg == "---":
bot.send_message(id, "---")
i = open("---.doc",'rb')
bot.send_document(id, i)
bot.polling(none_stop = True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question