Flectone Logo FlectonePulse

Discord

Integration with Discord allows sending messages (Discord ↔ Hytale) between the Hytale server and a Discord server.

discord message
minecraft message

Information

For the bot to work correctly, enable three settings for your bot in the Discord Developer Portal

develop

Also grant the bot permissions for Read Messages, Send Messages, and Use Webhooks

Message Types

Any module that sends a message also has its own type, which can be found here

TypeExplanation
ADVANCEMENTAdvancement message
DEATHDeath message
MESSAGE_CHAT_GLOBALMessage from global chat
MESSAGE_CHAT_LOCALMessage from local chat
SERVER_ENABLEServer enable message
SERVER_DISABLEServer disable message
......
Note

If you have your own chats with custom names, for example admin, you will need to specify MESSAGE_CHAT_ADMIN. If you have your own groups from the vanilla module, you need to specify their name


🌍 Localization

Path localizations → language.yml → integration.discord
discord:
  null_player: "This player does not exist"
  sender_name: "Discord"
  format_reply: "<fcolor:4><hover:show_text:'<fcolor:4><reply_message>'>[Reply to @<reply_user>]</hover> "
  custom_command:
    ping:
      content: "<player>'s ping is <replacement:ping>"
  info_channel:
    id: "TPS <replacement:tps>"
  message_channel:
    INTEGRATION_DISCORD:
      content: "<fcolor:2><global_name> <fcolor:1>» <fcolor:4><reply><message>"
    MESSAGE_CHAT_GLOBAL:
      content: "<final_message>"
discord:
  null_player: "Игрок не найден"
  sender_name: "Discord"
  format_reply: "<fcolor:4><hover:show_text:'<fcolor:4><reply_message>'>[Ответ на @<reply_user>]</hover> "
  custom_command:
    ping:
      content: "Пинг игрока <player> равен <replacement:ping>"
  info_channel:
    айди: "ТПС <replacement:tps>"
  message_channel:
    INTEGRATION_DISCORD:
      content: "<fcolor:2><global_name> <fcolor:1>» <fcolor:4><reply><message>"
    MESSAGE_CHAT_GLOBAL:
      content: "<final_message>"

null_player

Message if the player entered via custom_command is not found

sender_name

Name of sender (of integration itself), which will be used, for example, in another integration for placeholders

format_reply

Message format for the <reply> tag when the message is a reply to another one

custom_command

List of custom integration commands, where the key is the command name and the value is its message format

Example
custom_command:
  tps:
    content: "<tps>"

Command to get the tps value on the server. Don't forget to create it in integration.yml

Placeholders

You can use all placeholders that are used in the initial message for Hytale

EXAMPLE FOR BAN MESSAGE

There is a <reason> placeholder there, so I can use <reason> inside Discord messages

There are also placeholders that will DEFINITELY be replaced in any message

  • <final_message> message sent to Hytale
  • <final_clear_message> message sent to Hytale without unicode emojis
  • <player> nickname of the player who sent the message
  • <message> raw message written by the player
  • <plain_message> formatted message written by the player
  • <reply> formatted reply message, it will be empty if the main message is not a reply
  • Obviously, all placeholders from PlaceholderAPI and FlectonePulse will also work

The message that will be sent from Discord to Hytale has its own placeholders:

PlaceholderWhat it returns
<name>Global name of the Discord member
<global_name>Global name of the Discord member
<nickname>Nickname of the Discord member
<display_name>Display name of the Discord member
<user_name>Discord member's tag

info_channel

List of channel IDs and their names for displaying some information, such as TPS

message_channel

List of messages with their settings

message_name:
  content: ""
  webhook_name: "<player>"
  webhook_avatar: ""
    embed:
    color: ""
    title: ""
    url: ""
    author:
      name: ""
      url: ""
      icon_url: ""
    description: ""
    thumbnail: ""
    fields:
      - name: ""
        value: ""
        inline: false
    image: ""
    timestamp: true
    footer:
      text: ""
      icon_url: ""
Information

Message with all parameters

discord

If a parameter is empty or not written, it will not be used in the final message


⚙️ Setting

Path integration.yml → discord
discord:
  enable: false
  ignore_all_bots: true
  token: ""
  custom_command:
    ping:
      need_player: true
      aliases:
      - "!ping"
  presence:
    enable: true
    status: "ONLINE"
    activity:
      enable: true
      type: "PLAYING"
      name: "FlectonePulse"
      url: "https://flectone.net/pulse/"
  channel_info:
    enable: false
    ticker:
      enable: true
      period: 1200
  message_channel:
    INTEGRATION_DISCORD:
    - "123456"
    MESSAGE_CHAT_GLOBAL:
    - "123456"
  destination:
    type: "CHAT"
  sound:
    enable: false

enable

Enables or disables the functionality of the module

Warning
  • Before enabling, insert the Discord bot token
  • After enabling, it is RECOMMENDED to restart the server, otherwise the plugin may cause a freeze

ignore_all_bots

If enabled, messages from any users who are bots will be ignored. Otherwise, only the current bot's own messages will be ignored

token

Token of the Discord bot for connection. You can use environment variables, for example ${VALUE}

custom_command

List of custom integration commands, the key is the command name and it can be anything. Commands can ONLY be informational; they do not and will not execute anything on the server

ParameterExplanation
need_playerWhether to check the first command argument for a player name, e.g., !ping TheFaser
aliasesList of aliases for using the command
Example
custom_command:
  tps:
    need_player: false
    aliases:
      - "!tps"
      - "!tickpersecond"

Command to get the tps value on the server using !tps or !tickpersecond. Don't forget to create a message in localization

presence

discord presence

channel_info

discord channel info

message_channel

List of message types and Channel IDs in Discord

For example, I want a `/ban` command message to be sent from Hytale to Discord

Copy the channel ID in Discord 1286666844358316083

Set COMMAND_BAN: "1286666844358316083"

message_channel:
  COMMAND_BAN: 
    - "1286666844358316083"

Localization can be left unconfigured; by default, the message will be sent with the <final_message> format

destination

Where the message will be sent

TypeExplanationRequires additional configuration?
ACTION_BARMessage above the player's inventoryYes
CHATMessage to chatNo
TITLEFullscreen messageYes
SUBTITLEFullscreen message (top line)Yes
TOASTNotification in the bottom right cornerYes

sound

Sound playback


🔐 Permissions

Path permission.yml → integration.discord
discord:
  name: "flectonepulse.module.integration.discord"
  type: "TRUE"
  sound:
    name: "flectonepulse.module.integration.discord.sound"
    type: "TRUE"

name

Permission name

type

Permission type

TypeExplanation
TRUEAvailable to any player
FALSEAvailable to no one, must be granted separately (e.g., using LuckPerms)
OPAvailable to server operators
NOT_OPAvailable to NON-operators of the server

sound

Permission to use the sound

Last updated on

Edit on GitHub

On this page

Authors of page