Skip to content

quoiFeur game doesn't mute correctly #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
neolectron opened this issue Sep 6, 2023 · 1 comment
Closed

quoiFeur game doesn't mute correctly #58

neolectron opened this issue Sep 6, 2023 · 1 comment

Comments

@neolectron
Copy link
Member

neolectron commented Sep 6, 2023

Problem

The quoiFeur game has 1/20 chance to respond with coubeh, it mutes you whenever it happens.
The muting strategy goes with adding a role Muted to the user, which we remove after 15min.
This have many edge-cases such as:

  • one time, the role was deleted and not re-created (cache miss?)
  • it makes uses of setTimeout, so when the bot reload we have to clear the role
  • Moderators are most of the time above the muted role, so it doesn't work for them
  • We have to keep track of a role, give it some defaults, etc..

Solution

Use native timeout feature by discord (found by @smaiill on discord, thx).
It would solve many of the issues above, while also simplifying the code.
Here is the link to discord.js documentation for that.
image

Drawbacks

I think there is no such thing as beeing timeout in only one channel.
But considering the low duration of the timeout, and the amount of benefits, I think it's a good tradeoff.

@neolectron
Copy link
Member Author

fixed by #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant