DiscordSRV

DiscordSRV

86.8k Downloads

Allow mentions in alerts

PadowYT2 opened this issue ยท 3 comments

commented

Why?

If you want to ping @everyone in an alert, you won't be able to if config.yml#DiscordChatChannelAllowedMentions has everyone. Doing that, will allow any user to ping @everyone, which is bad

What and How?

No idea what would be the best, but either

  • Allow all mentions in alerts
  • Make an another configuration option for allowedMentions

Are there alternatives?

Not that I can think of

Checks

  • I have used the search at least once to check if my idea has already been suggested and perhaps already implemented.

Anything else

No response

commented

What I said in the other thread issue

Why?

It is not currently possible to make alerts that ping any roles or accounts in discord. This placeholder would make it possible to make alerts that ping someone's discord account based off of their linked minecraft account. A example of this which people on my server have been asking for is to get pinged when they die while afk.
What and How?

The alerts.yml file would have a new placeholder that pings a players linked discord account if an alert is a player event. The placeholder would only parse in the Embed in the embed text sections of the alerts file. The placeholder would basically put this in discord <@!UserID> (this string allows embeds to ping users). It would replace the UserID with the linked players user id from the accounts.aof file.
Are there alternatives?

I really don't think there are alternative ways to do this. You need people to have their accounts linked pretty much and allowing plaintext @user pings in the embed sections of alerts isn't possible from what I can see because of how discord embeds work.

commented

I really think that the systems for pinging roles and pinging individual people should be different for multiple reasons. Very rarely will alerts need to ping just one set account and most of the time people are going to want alerts to ping accounts based on the person the alert is for hence having a placeholder. The way embed pings work on discord means that having any @ ping on its own in the alert won't work unless the @ pings where placeholders anyway.

How Embed Pings Work:
https://stackoverflow.com/questions/66953764/how-to-ping-a-role-in-a-discord-js-embed

Let me know if I got anything wrong, but practically I don't really see another solution.

commented

Also I have no idea how to add text to an alert without it being in an embed I couldn't find a way to do that. But either way it needs to be a placeholder to really work for an alert.