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

fixed bot spamming, updated /register and /stat #320

Merged
merged 5 commits into from
Feb 12, 2024

Conversation

rainett
Copy link
Contributor

@rainett rainett commented Feb 9, 2024

Bot used to answer EVERY message it received in guild. Now this logic is deleted.

/stat used "admin" role to check if user has privilege to use the command. Now the role name is specified in .properties, so StatCommand uses the property, and not a hardcoded string.

/register could be used only if we had stored user in DB. Now, if user's entity is missing, it will be automatically created when he passes the registration. (By default, it is still created when user joins a guild).

@rainett rainett requested a review from Kiriche February 9, 2024 14:10
user.setUserId(userId);
user.setGuildId(guildId);
user.setDateRegistration(LocalDate.now());
return user;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we save the created user into db in such case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User is saved a bit later, when he passes the registration and submits his GitHub username. But if it is more convenient, I can add that line here

Copy link

@lez-doit lez-doit Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we save the data later, it's alright. However, I suppose it would be better to use getUser method only for getting some actual users from DB, and extract the logic of their creation somewhere else.

@rainett rainett merged commit 7a1e38d into Broscorp-net:master Feb 12, 2024
1 check passed
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.

4 participants