Answer the question
In order to leave comments, you need to log in
PyTelegramBotAPI not working message_handler in group?
The problem is that the check_user_input method is not called in the group with the bot, but if you try this whole thing not in the group, but write to the bot itself in a personal message, then everything works fine ... What's the problem?
@bot.message_handler(commands=["searchimage"])
def imageByName(message):
bot.send_message(message.chat.id,
f"{message.from_user.first_name} enter search text",
parse_mode="html")
usersID.append(message.from_user.id)
@bot.message_handler(content_types=['text'])
def check_user_input(message):
print("Here")
if usersID.__contains__(message.from_user.id):
searchimage(message, message.text)
usersID.remove(message.from_user.id)
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