I am making a telegram bot by using python-telegram-bot and I added it to a group.

I want to specify a list, and if the sentences in the list are sent to the group, the 。telegram's robot will delete that message from the group. What modules and codes should I use to do this?

Please give me a full description. I'm new

python telegram-bot python-telegram-bot 597

出处 分享

创建 06 8月. 17 2017-08-06 12:33:36

电报群组从列表删除

You can use

bot.DeleteMessageAsync(chatId, messageId)

you should make it in a try catch in case the message doesn't exist anymore or you have a wrong messageId,

messageId is a property which you get in MessageEventArgs.Message,

Note: the chatId should be the Group/Channel chatId and not of the user wh!o sent it, get that in Chat.Id property of MessageEventArgs.Message ...

好像假如您的Telegram机器人容许群组,任何人都可以将机器人!添加到任何群组,而不但仅是机器人的创建者。

怎样察看机器人连接的群组? 怎样从群组中删除机器人?

我的僵尸程序已被!添加到几个超级组中,天天向其发送100k条消息。我想从这些组中删除它,但仍旧容许机器人在其他组中。

本文网址: http://www.1cm8858.com/d/20201029174859_7824_1427594603/home