TCLRainbow / DimBot

A Discord bot that does a lot of stuff
https://discord.com/api/oauth2/authorize?client_id=574617418924687419&permissions=1999957094&scope=bot
3 stars 2 forks source link

Aegis' actions should not be blocked by message rate limit #73

Open Pythonic-Rainbow opened 3 years ago

Pythonic-Rainbow commented 3 years ago

https://github.com/TCLRainbow/DimBot/blob/441d2a8eab12b314a2726ef141be252e806f3ffe/mod/ikaros.py#L22

In theory, when a raid happens, DimBot will suffer from message rate limit. As all moderation actions within Ikaros requries ensure_target() to callback, this may make DimBot unable to mute/kick all offenders in time.

Proposal: Convert Attempting to lock's await statement into create_task(), then for Target locked/Cannot lock target as well as Muting/has been kicked etc. messages, chain them after the Attempt lock's task.

This should allow DimBot to only schedule the messages, act on offenders, then send the messages later.