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

Tellraw escape #34

Closed
XmiliaH opened this issue Dec 4, 2018 · 6 comments
Closed

Tellraw escape #34

XmiliaH opened this issue Dec 4, 2018 · 6 comments

Comments

@XmiliaH
Copy link

XmiliaH commented Dec 4, 2018

First of all, I didn't test these. But I wondered where " is escaped from discord to minecraft messages. I didn't find a place, so you can escape the tellraw json and add styles with clickable links & commands.
Also it should be possible to send § from discord to minecraft.
From minecraft to discord @here & @everyone should be escaped. Normally the bots shouldn't have perms to mention everyone, but I saw servers giving the Bots roll Admin permissions.
I'm sorry if these are already handled somewhere and I oversaw it.

@ghost
Copy link

ghost commented Dec 4, 2018

From minecraft to discord @here & @everyone should be escaped.
here and everyone should be handled by permissions. If a server admin doesnt prevent this, it is their own responsibility, since running third-party code with admin privilege is always a security risk.

Also it should be possible to send § from discord to minecraft.
Did you test this?

@XmiliaH
Copy link
Author

XmiliaH commented Dec 4, 2018

First of all, I didn't test these.
Just looked through the code and wondered.

@destruc7i0n
Copy link
Owner

Ah, these are good points you've brought up. I used to use JSON.stringify but an update made it simply use .replace, which doesn't escape it, will need to get a fix for that... As for the mentions part, I actually used to use that as a feature, but it would be good to be an option for people working out of the box, I'll do that at some point.

@Thomas-Driessen
Copy link

Thomas-Driessen commented Dec 26, 2018

The bot is still able to mention @everyone and @here without having the permission to mention when creating the invite link, and also have mention disabled in the channel. Forgive me for asking, am I still missing something or is this a bug?

@Heath123
Copy link

It's because you're using a webhook. It should be easy enough to fix in the code by adding .replace("@everyone", "@ everyone").replace("@here", "@ here")

@destruc7i0n destruc7i0n mentioned this issue Feb 4, 2020
@destruc7i0n
Copy link
Owner

Fixed that @everyone and @here problem, also added an option if you want to re-enable it.

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

No branches or pull requests

4 participants