Skip to content

TopHelpersCommand message is too long #603

Closed

Description

@Zabuzard

Issue

The TopHelpersCommand message is too long and crashes:

crash

Stacktrace:

stacktrace

Gotta make it a bit smaller.

Fix

We can just reduce the amount of people it lists from 20 to, lets say, 18:

https://github.com/Together-Java/TJ-Bot/blob/develop/application/src/main/java/org/togetherjava/tjbot/commands/tophelper/TopHelpersCommand.java#L43

To reproduce the issue locally and test whether that did the trick, one would have to fake the result returned by the DB call here:

https://github.com/Together-Java/TJ-Bot/blob/develop/application/src/main/java/org/togetherjava/tjbot/commands/tophelper/TopHelpersCommand.java#L71

Or directly put some fake data into the database in order to hit the limit of 20 people. Also, they should have a message count of around 10000 each. All of this contributes to the size of the message.

Activity

  1. added
    bug
    on Oct 4, 2022
  2. Tais993 commented on Oct 4, 2022

    @Tais993
    Member

    If possible, can you give screenshots on how the command should look?

  3. Zabuzard commented on Oct 4, 2022

    @Zabuzard
    MemberAuthor

    it just posts a code formatted message with a table generated by a framework. its just text.

    message

  4. Tais993 commented on Oct 4, 2022

    @Tais993
    Member

    That's indeed really error prone, solution will be to either implement pagination support (and embeds), or create multiple messages

  5. Zabuzard commented on Oct 4, 2022

    @Zabuzard
    MemberAuthor

    for now, its enough to just reduce the amount of users it displays. its like limitted to 30 or so. can just reduce that to 25 or sth like that.

  6. Gyoo commented on Oct 5, 2022

    @Gyoo
    Contributor

    Issue looks similar to #533, but I don't think we can fit all cases in a single solution. Each output should have their own way of dividing messages, or finding workarounds like Zabu mentioned

  7. Zabuzard commented on Oct 5, 2022

    @Zabuzard
    MemberAuthor

    Yeah. Its just the message being too long and we have to shrink it. Should have been thought of when creating this feature in the first place, but was forgotten. Remove a few people from the table and all good. Should be simple enough.

  8. Taz03 commented on Oct 6, 2022

    @Taz03
    Contributor

    what about instead we give the output in a text file?? then we won't have to compromise on the number of top helpers we can fetch.

    For a command which don't gets used that much, being have to click a few extra buttons should be ok ig

  9. Zabuzard commented on Oct 7, 2022

    @Zabuzard
    MemberAuthor

    possible, but its really not that big of a deal. just edit the constant i linked in the issue and done. this fix costs 30 seconds and is totally fine.

  10. self-assigned this
    on Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issuehelp wantedpriority: normal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions