-
-
Notifications
You must be signed in to change notification settings - Fork 101
TopHelpersCommand message is too long #614
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
Conversation
68a7866
to
3a94d89
Compare
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.
Can you add screenshots of how it looks now?
application/src/main/java/org/togetherjava/tjbot/commands/tophelper/TopHelpersCommand.java
Show resolved
Hide resolved
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.
next time give screenshot of before your changes and after.
Would make it a little easier to understand what actually changed
sure. was just a bit difficult, since i dont have 20+ users on my private server to make the problem obvious. and i was too lazy to mock the DB just for screenshots. and the real tables from PROD contained sensitive info that i also was too lazy to mock lol. but yeah, agreed. |
* limit long user names * move description before table * reduce amount of helpers listed
8cb5b76
to
4944510
Compare
just rebased, no code changes. already had 2 approvals. merging once pipeline succeeds |
Kudos, SonarCloud Quality Gate passed! |
Overview
Fixes #603 which describes a bug when using
/top-helpers
resulting in a too long message, not accepted by Discord.The approach is simple yet effective:
these factors effectively reduced the message that was too long from 2300 characters down to 1100 characters, which is perfectively within limits.
Notes
Since this class also needed abbreviation logic, I elevated the
abbreviate
method from within theDiscordLogForwarder
toMessageUtils
. And also gave it a unit test.