I create a telegram bot using the Python-Telegram-Bot framework and the Re Module.
The bot should delete the stickers the members send to the group, that is, when the word is start
send to the group, it will delete the bot stickers that are sent after the group start
.
My code:
from telegram.ext import Updater, MessageHandler, Filters
import re
def delete_method(bot, update):
mlist=['/start']
for i in mlist:
if re.match(i, update, message.text):
update.message.delete()
def main():
updater = Updater(token='TOKEN')
dispatcher = updater.dispatcher
dispatcher.add_handler(MessageHandler(Filters.all, delete_method))
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()
# for exit
# updater.idle()
But the bot does not work, that is, after sending the word start
of the send to the group, it does not delete the stickers that are sent to the group.
The codes do not give any errors.And the group is a super group, and the bot is admin and it has access to messages!
What do you think is the problem ???