Answer the question
In order to leave comments, you need to log in
How to add "yes or no" selection conditions?
It is necessary to make it so that after "... is the correct name?" there was a yes or no choice.
If yes, then send the add message, if not, then return to "Name the clan"
@bot.message_handler(content_types=['text'])
def get_text_messages(message):
if message.text.lower().startswith('!создать клан'):
chat_id = message.chat.id
bot.send_message(message.chat.id, 'Назовите клан:',)
bot.register_next_step_handler_by_chat_id(chat_id, get_name)
if message.text == ('!Вступить в Клан') or message.text == ('!вступить в клан') or message.text == (
'!Вступить в клан') or message.text == ('!ВСТУПИТЬ В КЛАН'):
chat_id1 = message.chat.id
bot.send_message(message.chat.id, 'В какой клан хотите вступить?', reply_to_message_id=message.message_id, reply_markup=markup_menu_1)
return (chat_id1)
def get_name(message):
cht_id = message.from_user.id
new_name = message.text
bot.send_message(message.chat.id, new_name + ' - верное название?')
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