Skip to content

SlashCommandEducator should check length #782

@Zabuzard

Description

@Zabuzard

To reduce false positives, SlashCommandEducator should additionally check the length of the message and not send its advice if the message is longer (> 30).

Currently it only checks the regex:

regex

So we should just add a simple && content.length() < MAX_COMMAND_LENGTH to that, with MAX_COMMAND_LENGTH = 30.

Also adjust the unit tests in SlashCommandEducatorTest, to add one of the real messages where it triggered falsely:

.isLetter and .isNumber are available

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions