Minecraft Discord Messenger [1.13 - 1.21]
0.1Script for sending messages to Discord via Webhook URL written in Skript

Hello, Minecraft community!
I present to your attention a script written in Skript for sending messages to Discord via a webhook URL.
You can generate messages in JSON format and send them to the webhook of the URL Discord channel.

The script has two main functions.
The first one generates a message in JSON format, and the second one sends this message to the Discord channel.
1. Function prepareDiscordMessage
Function to format message in JSON format.
function parameters
Parameters:
● avatarUrl: Avatar for Discord bot
● botUsername: Username for Discord bot
● embedTitle: Embed title
● embedDescription: Embed description
● embedFooter: Footer text
● embedColor: Embed color
Usage example:
An example of the result of formatting a message for further sending as a message to the Discord channel.
set {_discordMessage} to prepareDiscordMessage(BotAvatar(), BotUsername(), "%event-player% has joined the server", "The player **%event-player%** has joined the server.", FooterText(), GreenColor())
Result:
'{ ""embeds"": [{ ""title"": ""CHYZHOV has joined the server"", ""description"": ""The player **CHYZHOV** has joined the server."", ""color"": 3066993, ""footer"": { ""text"": ""Date of action execution: 02.11.2024, 02:49"" } }], ""username"": ""System alert"", ""avatar_url"": ""https://cdn.discordapp.com/attachments/1014147200701435965/1294052865836318791/star-fall-svgrepo-com.png?ex=6714d0e5&is=67137f65&hm=aecc0259e4c8eda035b42ac9b414ea87c6d1d7e82a23fa21a3519273ef64ded3&"" }'
2. Function sendDiscordMessage
Function for sending messages to the Discord channel.
function parameters
Parameters:
● message: Message in JSON format
● channel: Channel webhook URL
Usage example:
When a player joins a server, a message will be sent to the Discord channel about it.
on join:
set {_discordMessage} to prepareDiscordMessage(BotAvatar(), BotUsername(), "%event-player% has joined the server", "The player **%event-player%** has joined the server.", FooterText(), GreenColor())
sendDiscordMessage({_discordMessage}, Channel())
Result:
The message was sent to the Discord channel.
result image


For more convenient use of the script, you can use such functions as those listed below.
Override the values in the functions below.
1. Bot avatar
Specify a link to the bot's avatar, which will be displayed in the discord message.
function BotAvatar() :: string:
return "https://cdn.discordapp.com/attachments/1014147200701435965/1294052865836318791/star-fall-svgrepo-com.png?ex=6714d0e5&is=67137f65&hm=aecc0259e4c8eda035b42ac9b414ea87c6d1d7e82a23fa21a3519273ef64ded3&"
2. Bot username
The name of the bot will be displayed in the discord message.
function BotUsername() :: string:
return "System alert"
3. Footer text
The text will be displayed in the footer of the Discord message.
function FooterText() :: string:
return "Date of action execution: %now%"
4. Red color
The color code variant for the embed in the Discord message.
function RedColor() :: integer:
return 13458524
5. Yellow color
The color code variant for the embed in the Discord message.
function YellowColor() :: integer:
return 15844367
6. Green color
The color code variant for the embed in the Discord message.
function GreenColor() :: integer:
return 3066993
7. Channel
Link to the webhook of the URL channel to which the message will be sent.
function Channel() :: string:
return "https://discord.com/api/webhooks/your_webhook"

Please pay attention to this information!
For the script to work, you need to install some plugins.
1. Skript - https://www.spigotmc.org/resources/skript.114544/
2. skript reflect - https://www.spigotmc.org/resources/skript-reflect.82259/
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta