Answer the question
In order to leave comments, you need to log in
How to make the bot automatically reply to the specified message with the specified answer?
An example is this:
I indicate the response to the message "Hello everyone!" the answer is "Hi!"
And when any person writes Hello everyone! The bot answered with the given answer, that is, "Hi!"
And so I want to do with many messages. Not limited to one message
Answer the question
In order to leave comments, you need to log in
If this is a telegram bot and you are using pyTelegramBotAPI
You can do this:
@bot.message_handler(content_types=["text"])
def message_reply(message):
if message.text == 'Hi':
bot.send_message(message.chat. id,'Hi')
elif message.text =='Fuck you':
bot.send_message(message.chat.id,'Here you go')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question