Sends an embedded Themis notification to a discord webhook.
Depends on Themis. If you want to use the %os% placeholder in the config file you will also need Floodgate.
- Place the ThemisToDiscord.jar file in your /plugins folder.
- Start or restart the server
- Run
/ttd url <webhookUrl>(replace<webhookUrl>with your webhook url) - Configure your messages if necessary following modifications with
/ttd reload - Optionally, test your messages by running their respective commands
/ttd msg <message> <player:player_name> <type:detection_type> [score:score] [ping:ping] [tps:tps]to ensure the setup is functioning
You can create as many messages as you need/want. For each message you have the option to define the handling.
To do this, you use the same thresholds and delays included in the Themis configuration.
default:
# Define whether ThemisToDiscord should handle sending this message
# Disable handling if you add this message's command to your Themis action(s)
Handling:
Enabled: true
# What is the minimum score for a notification to be sent to the discord?
execution-threshold: 10.0
# What amount of new violations need to happen before another notification is sent?
repetition-threshold: 5.0
# What amount of time needs to pass before another notification is sent?
repetition-delay: 10.0Should this option be missing or disabled, ThemisToDiscord will not handle sending the message.
This means the only way for the message to be sent would be the corresponding command:
/ttd msg <message> <player:player_name> <type:detection_type> [score:score] [ping:ping] [tps:tps]
A simple example of having Themis handle the message would be to disable handling in the ThemisToDiscord configuration and then place the message's command in a Themis action such as the following:
actions:
# What is the name of the action? This name needs to be unique.
notify:
# What is the minimum score for Themis to run this action?
execution-threshold: 10.0
# Which amount of new violations need to happen for this action to be repeated?
repetition-threshold: 5.0
# Which amount of time needs to pass for this action to be repeated?
repetition-delay: 10.0
# Which commands should be run? You can specify as many as you'd like which will be run in the order they're listed.
# Currently, you can use the following placeholders: %player_name%, %detection_type%, %score%, %ping%, %tps%
commands:
- "themis notify §5[Themis] §4%player_name% §cwas flagged for §4%detection_type% §chacks!\n§c[Score: §4%score% §c| Ping: §4%ping% §c| TPS: §4%tps%§c]"
- "ttd msg example player:%player_name% type:%detection_type% score:%score% ping:%ping% tps:%tps%"You can specify the actual JSON message that will be sent to Discord via the webhook url. This is great for designing messages with https://discohook.org.
A small example:
# Defines the json data used to construct the message
# This is useful if you want to design your message/embed with https://discohook.org/
# All other options are ignored if json is provided
Json: >
{
"content": "Hello this is an example of including a JSON string!",
"embeds": [
{
"title": "JSON Example",
"description": "A little example of using JSON in a ThemisToDiscord message.",
"color": 5055373,
"fields": [
{
"name": "Example Field",
"value": "Did you know, all placeholders will work inside JSON too!",
"inline": true
},
{
"name": "Another Field",
"value": "This is another field!",
"inline": true
}
],
"author": {
"name": "%player_name%",
"icon_url": "%avatar_url%"
}
}
],
"attachments": []
}It is important to note that all other options (beside webhook urls) will be ignored should JSON be provided.
All of these colors can be modified via the config file.
| Check Type | Hex Color | Textual Color |
|---|---|---|
| Boat Movement | #875229 |
Light Brown |
| Flight / Y-Movement | #3276bf |
Light Blue |
| Speed | #d6e600 |
Neon Yellow |
| Spoofed Packets | #ff0000 |
Neon Red |
| Timer / Blink | #d61ad6 |
Neon Pink |
| Reach | #6f1ad6 |
Neon Purple |
| Elytra Flight | #afaeb0 |
Light Gray |
| Illegal Packets | #141414 |
Black Shade |
For servers with DiscordSRV installed this plugin may not be necessary.
DiscordSRV comes with the command /discordsrv broadcast [#ChannelID/#ChannelName] <Message> documented here.
It allows dispatching a message to the specified channel or if omitted to the main channel.
Therefore, one could add the following to the actions key in their Themis configuration file to receive basic Discord notifications.
actions:
# What is the name of the action? This name needs to be unique.
discord:
# What is the minimum score for Themis to run this action?
execution-threshold: 10.0
# Which amount of new violations need to happen for this action to be repeated?
repetition-threshold: 5.0
# Which amount of time needs to pass for this action to be repeated?
repetition-delay: 10.0
# Which commands should be run? You can specify as many as you'd like which will be run in the order they're listed.
# Currently, you can use the following placeholders: %player_name%, %detection_type%, %score%, %ping%, %tps%
commands:
- "discordsrv broadcast #0000000000000000000 [Themis] **%player_name%** was flagged for *%detection_type%* hacks! [Score: %score% | Ping: %ping% | TPS: %tps%]"You could simply copy the command to any existing Themis action as well.
This method was known well before the creation of this plugin. However, not all servers use DiscordSRV and ThemisToDiscord provides far more styling options including changing the name and avatar via webhook and sending color-coded embedded messages instead of plain generic ones.







