-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
…name from properties. Improved /register.
user.setUserId(userId); | ||
user.setGuildId(guildId); | ||
user.setDateRegistration(LocalDate.now()); | ||
return user; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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).