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

Formatted Invites Parsed Incorrectly #668

Closed
4 of 5 tasks
averen opened this issue Apr 21, 2018 · 8 comments
Closed
4 of 5 tasks

Formatted Invites Parsed Incorrectly #668

averen opened this issue Apr 21, 2018 · 8 comments
Labels
bug status: completed has been completed but is not yet released

Comments

@averen
Copy link
Contributor

averen commented Apr 21, 2018

General Troubleshooting

Hey there! Before you report a bug or suggest a new feature,
please make sure to follow these steps first!

  • I have checked for similar issues.
  • I have updated to the latest JDA version.
  • I have checked the branches or the maintainers' PRs for upcoming features/bug fixes.

This is not the place to learn Java. Please refer to StackOverflow
for your general programming questions.

Issue

Issue Type

  • Bug Report
  • Feature Request

For questions join the official JDA discord server: https://discord.gg/0hMr4ce0tIl3SLv5

Description

When instant invites are formatted using markdown, they are parsed incorrectly and include some markdown characters.

Example

The first message's contents is exactly __invite__ and the second ***invite***.

@Chiearf-Chaotic
Copy link

In this case, @averen is right,
image

@Chiearf-Chaotic
Copy link

A solution to this issue would be replacing unwanted markdown characters within the string with the help of regex:
image

@Chiearf-Chaotic
Copy link

Although, maybe more symbols might be added for further markdown removing.

@averen
Copy link
Contributor Author

averen commented Apr 21, 2018

Like I mentioned in discord, this is a sloppy solution. All characters outside of the standard 0-9, A-Z, and a-z should be stripped in the same regex expression. Also invites have set lengths depending on their purpose, this should be taken into consideration.

@MinnDevelopment
Copy link
Member

@averen vanity invites do not have a set length so that cannot be considered.

@averen
Copy link
Contributor Author

averen commented Apr 22, 2018

Ah I forgot about vanity invites. This PR should do the trick, however if the link is formatted with trailing underscores, they are still included.

image

@MinnDevelopment
Copy link
Member

That is true, if that isn't allowed in vanity invites I will not allow it in the regex but I have no way of confirming that. It seem as if those formattings aren't intended by discord anyway if you see an embed like that. The better way to do this is __<https://discord.gg/code>__ which prevents the additional embed to be generated.

@averen
Copy link
Contributor Author

averen commented Apr 22, 2018

In that case, this PR should be an appropriate fix.

@MinnDevelopment MinnDevelopment added the status: completed has been completed but is not yet released label Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: completed has been completed but is not yet released
Projects
None yet
Development

No branches or pull requests

3 participants