sglowery/Telegram-Repost-Bot

Auto-delete reposts

Closed this issue · 1 comments

Some users have requested a feature for Repost Bot to instantly delete detected reposts rather than simply calling them out. This should be toggled on a per-group basis.

Deleting messages is usually a problem for Repost Bot as it stores message ids of reposted messages, and when used with the verbose callout style can cause errors to be thrown when trying to reply to a deleted message. Enforcing the singular callout style may be needed if this option is enabled. It might be possible/desirable to have a separate set of strings for the bot to use if reposts are being deleted (e.g. "Repost alert! I'm deleting that. Sorry.")

Auto-deletion should be toggled with the /toggle command. The parameter could be autodelete or just delete, used like "/toggle delete". The value for this should also be displayed with the /settings command. An alternative would be to work on #10 and implement this feature as a new callout style and extend the singular callout style. #10 is going to be worked on anyway and this way there's no need to enforce against certain combinations of settings (e,g, having callout style set to verbose and auto delete set to true).

The bot must have permission to delete messages. Need to look into how this works in groups/supergroups vs. channels. It should be possible to check this permission when attempting to set this option and to not allow it if it doesn't have permission.

The Telegram update should still be processed normally, including adding the message id to the list mapped by the hash key. The message should be deleted after. If it can't delete messages, should the bot just fail quietly or send another message after calling out the repost?

Relies on #8 being completed.

Implemented in v0.5.0