backmeupplz / banofbot

@banofbot and @silent_banofbot Telegram bots code
https://t.me/banofbot
MIT License
163 stars 42 forks source link

Remove all chat messages when kicking user #44

Closed Arunmor1510 closed 1 year ago

Arunmor1510 commented 2 years ago

Hi, I find that banofbot is a very good bot, however it seems that when kicking a user, the user is banned and only one message is deleted, I hope there can be a option to delete all chat history of this user.

banofbot uses api kickChatMember, which is renamed to banChatMember, according to api changelog , the old one is still useable, and it has a option "revoke_messages" to delete all messages from the chat for the user that is being removed . I don't know about node bot api, but maybe we can try to add this option? Theoretically it should work. It will be very helpful, thanks.

backmeupplz commented 2 years ago

Hm, this sounds helpful

backmeupplz commented 2 years ago

Not sure if I have the capacity to pick this task up though :( but happy to review and merge PRs!

TrashAccount3424 commented 2 years ago

Hi, I find that banofbot is a very good bot, however it seems that when kicking a user, the user is banned and only one message is deleted, I hope there can be a option to delete all chat history of this user.

banofbot uses api kickChatMember, which is renamed to banChatMember, according to api changelog , the old one is still useable, and it has a option "revoke_messages" to delete all messages from the chat for the user that is being removed . I don't know about node bot api, but maybe we can try to add this option? Theoretically it should work. It will be very helpful, thanks.

revoke_messages does NOT delete the messages in the chat for the rest of the users, it deleted them for the user that is being banned. The difference between setting it to true and false is that in once case the chat will stay for the banned user and he can see everything up to the point he was banned. If its set to true the chat will disappear. This is only for legacy groups so in almost all cases this parameter is ignored anyway.