Skip to content

Commit

Permalink
[patch] Update autoslowmode formula
Browse files Browse the repository at this point in the history
  • Loading branch information
Exenifix committed Feb 19, 2023
1 parent 95d9b75 commit c211a9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/autoslowmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ async def autoslowmode_controller(self, message: disnake.Message):
return

try:
new_slowmode = int(30 / (queue.getright().created_at - queue.getleft().created_at).seconds)
if abs(new_slowmode - message.channel.slowmode_delay) >= 5:
new_slowmode = round(60.0 / (queue.getright().created_at - queue.getleft().created_at).seconds)
if new_slowmode < 3:
new_slowmode = 0
if abs(new_slowmode - message.channel.slowmode_delay) >= 3:
await message.channel.edit(
slowmode_delay=new_slowmode,
reason="Autoslowmode",
Expand Down

0 comments on commit c211a9e

Please sign in to comment.