DiscordSRV

DiscordSRV

86.8k Downloads

Add javascript conditions for Minecraft Players being (not) able to see messages that come from Discord server

TheJoshue opened this issue ยท 0 comments

commented

Why?

For example:

  • Discord has an option to hide channels, so if the user has not yet linked their discord account with in-game account, we can customize if he can even see that channel or not.
  • Why not add this from the Minecraft side too? So like, if your account is not linked, you will not receive any discord messages ingame. This option would allow that + anything that includes PAPI placeholders also for messaging.

What and How?

This is the current look as of DiscordSRV v1.26.2 at the config part where webhooks and minecraft chat messages are found:

# Webhook Delivery
Experiment_WebhookChatMessageDelivery: false
Experiment_WebhookChatMessageUsernameFormat: "%displayname%"
Experiment_WebhookChatMessageFormat: "%message%"
Experiment_WebhookChatMessageUsernameFromDiscord: false
Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}

<...>

DiscordChatChannelDiscordToMinecraft: true
DiscordChatChannelMinecraftToDiscord: true
DiscordChatChannelTruncateLength: 256
DiscordChatChannelTranslateMentions: true
<...>

With this feature option it would look something like this

# Webhook Delivery
Experiment_WebhookChatMessageDelivery: false
Experiment_WebhookChatMessageUsernameFormat: "%displayname%"
Experiment_WebhookChatMessageFormat: "%message%"
Experiment_WebhookChatMessageUsernameFromDiscord: false
Experiment_WebhookChatMessageAvatarFromDiscord: false
Experiment_WebhookChatMessageUsernameFilters: {}
Experiment_WebhookChatMessageConditions: # THE POTENTIAL OPTION I AM EXPLAINING
  - "'%discordsrv_user_islinked%' == 'true'" # it can also support && and more conditions as it is a list

<...>

DiscordChatChannelDiscordToMinecraft: true
DiscordChatChannelDiscordToMinecraftConditions: # THE POTENTIAL OPTION I AM EXPLAINING
  - "'%discordsrv_user_islinked%' == 'true'" # it can also support && and more conditions as it is a list
DiscordChatChannelMinecraftToDiscord: true
DiscordChatChannelTruncateLength: 256
DiscordChatChannelTranslateMentions: true
<...>

Are there alternatives?

I think you can use some chat filter plugin to filter out all "[Discord]" messages from the chat for specific player but that would involve probably a custom coded plugin because they probably also don't have option for conditions, maybe not even PAPI support and are presumably much smaller plugin.

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