B
B
Bruh_Bruh2022-03-16 19:43:53
Python
Bruh_Bruh, 2022-03-16 19:43:53

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

1 answer(s)
B
Bruh_Bruh, 2022-03-16
@Bruh_Bruh

I tried to give the bot an admin, everything works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question