Skip to content
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

Add counting punishment #257

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Add counting punishment #257

wants to merge 10 commits into from

Conversation

granpacho
Copy link

@granpacho granpacho commented Sep 4, 2024

Make sure to change the .getRoleById() to a new role you make that doesn't have send messages perm in #counting

made from suggestion

@MLGPenguin
Copy link
Member

Hi Gran,

A couple notes on this that I'd like you to knock out before merging:

  • Don't use the executor service, it's not persistent (i.e. bot restarts) and will consistently create the need for manual intervention, rather use mongo to store those whom are currently barred and manually deny their valid counts.
  • Additionally, I think it would be best if these people remained able to speak in the counting channel, just not count, e.g. when they provide a valid count, remove it manually and notify them that they have 'x' time left before they can count again.
  • Fix your whitespace- stick to 4 spaces per indent as is standard throughout the rest of the project.

Once these are done I'll re-evaluate as having changed the indentation of every line, it makes it hard to view the actual change log.

@granpacho
Copy link
Author

granpacho commented Sep 5, 2024

  • Don't use the executor service, it's not persistent (i.e. bot restarts) and will consistently create the need for manual intervention, rather use mongo to store those whom are currently barred and manually deny their valid counts.

For the mongo, how would I check the time they get to count again? Does mongo have a storage for time? I wouldn't really know how to do it with SQL either since I don't work with timers much

  • Fix your whitespace- stick to 4 spaces per indent as is standard throughout the rest of the project.

On IntelliJ my tab space is set to 4 spaces, I'm not sure how to fix that since its already at 4

image

@MLGPenguin
Copy link
Member

There's a few ways you could do date times in mongo, personally I'd store the timestamp their punishment expires i.e. via System.getCurrentTimeMillis() and add hours * 60 * 60 * 1000 to this time as the punishment expiry time.

@granpacho
Copy link
Author

There's a few ways you could do date times in mongo, personally I'd store the timestamp their punishment expires i.e. via System.getCurrentTimeMillis() and add hours * 60 * 60 * 1000 to this time as the punishment expiry time.

No I get that part, I meant like how to check, like do I set something up that constantly checks the time? Thats the part I'm confused on

@granpacho
Copy link
Author

granpacho commented Sep 5, 2024

I mean I could get the information from mongo on start and make schedulers based on that, so if the bot restarts the schedulers will go back, or I could have a scheduler check every minute or two

@MLGPenguin
Copy link
Member

What are the schedulers for? In my comment I meant dissolve the role entirely, and just deny valid counts manually in the listener if their time hasn't passed.

@granpacho
Copy link
Author

Oh yeah that makes sense I was thinking of something else

@granpacho
Copy link
Author

granpacho commented Sep 6, 2024

better? I changed to use mongo, cant figure out the indent thing though

@granpacho
Copy link
Author

that should be good now, idk if the indents are still messed up or not though

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

Successfully merging this pull request may close these issues.

2 participants