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

Fix of the default prefix @mention that was no longer responding to commands #40

Merged
merged 2 commits into from
Dec 26, 2021
Merged

Fix of the default prefix @mention that was no longer responding to commands #40

merged 2 commits into from
Dec 26, 2021

Conversation

brandonfl
Copy link

@brandonfl brandonfl commented Dec 12, 2021

Pull Request

Pull Request Checklist

Please follow the following steps before opening this PR.

PRs that do not complete the checklist will be subject to denial for
missing information.

Pull Request Information

Check and fill in the blanks for all that apply:

  • My PR fixes a bug, error, or other issue with the library's codebase.
  • My PR is for the ______ module of the JDA-Utilities library.
  • My PR creates a new module for the JDA-Utilities library: ______.

Description

Fix the bug #39 introduced in pr #13

The default @mention prefix will always be followed by a space since it's a mention.
Meaning this space is part of the prefix !
So need to add into counter the > character and the space, so 2 characters

image

as the makeMessageParts use substring(prefixLength, i) it detect the whitespace as the command and the real command as the argument...

image

Related code :

makeMessageParts into CommandClientImpl.java lines 739-L752

The @mention prefix will always be followed by a space since it's a mention. Meaning this space is part of the prefix ! So need to add into counter the > character and the space, so 2 characters
@brandonfl brandonfl changed the title Fix prefix length for @mention prefix Fix of the default prefix @mention that was no longer responding to commands Dec 12, 2021
@Chew Chew linked an issue Dec 20, 2021 that may be closed by this pull request
3 tasks
@freya022
Copy link

freya022 commented Dec 20, 2021

Nevermind, had a wrong master branch selected

This PR should fix it

@Chew Chew added this to the 1.24.0 (v1 LTS) milestone Dec 22, 2021
@Chew Chew enabled auto-merge (squash) December 26, 2021 16:26
@Chew Chew merged commit 28dc4f6 into Chew:master Dec 26, 2021
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.

Default @mention prefix no longer respected
3 participants