ivandardi / RustbotPython

A Discord bot for the Community Rust Language server, written in Python.
MIT License
16 stars 9 forks source link

Cleanup specific number of messages #24

Open kangalio opened 3 years ago

kangalio commented 3 years ago

It would be useful to specify a number in the ?cleanup, so that Ferris deletes at most that specific number of its messages.

For example, in this Discord discussion, I presented two snippets of code that produces quite verbose compiler output. I wanted to remove just those two long compiler outputs, but preferably not the experiments done above with Ferris. However, the ?cleanup commands wiped all the invocations, even the compact ones above.

kangalio commented 3 years ago

I see this has actually supposedly been implemented the entire time. It didn't seem to work though in the linked Discord messages.

Also, do I understand this code correctly: https://github.com/ivandardi/RustbotPython/blob/30d8d81a7f63bec848985ca8c70327286a7e5b31/bot/cogs/commands.py#L64-L69

This lets anyone delete up to 100 Rust bot messages at once? Without any restrictions? You could theoretically wipe out all of the bot's messages in a channel with this. Is my understanding correct and if yes, is this intended?

kangalio commented 3 years ago

About ?cleanup in general: as far as I can tell, there is no restrictions on who can use this command, in which channel, to which extent. Any server member could theoretically spam ?cleanup in any channel and eradicate the entire history of Ferris in that channel, if they go long enough. Is that intended behavior?