Skip to content

Webhook

Elikill58 edited this page Jun 13, 2023 · 6 revisions

Webhook

Enable to send messages as alerts to other platforms.

You can edit them at end of config.yml file. To check if they are working, use /n webhook.

Common configuration

All webhooks have similar configuration:

  • You can disable a type by set enabled to false.
  • You can change the cooldown for each type with cooldown.

Available webhooks types

Discord

How to create it ?

You need to create a new webhook on discord for the needed channel : (Right click on channel -> 'Edit channel' -> 'Manage webhook' -> 'New webhook'). Then, put the URL into url value.

Common behavior of all message type

So, this is all options :

To add embed content, you have to create an embed section. But, what is embed ? This is an example:

Embed discord example

So, this is all embed options :

  • color : Color of the vertical line on the left. Should be an integer but write as string like "65280" for green (More infos)
  • title : The embed title
  • description : The main description of the message
  • fields : Configure all fields showed at the end of the message. (3/line max). This is all options for each fields :
    • key : The name of the field (show in bold)
    • value : The content of the field (show below the key, not in bold)
    • inline : If the message is inline or not
  • thumbnail : The thumbnail message
  • footer : Configure the footer. It's a section which can contains the content of the footer in a value called name, and a link which will make this footer clickable.
  • author : Finally, you can configure an author section is in composed of :
    • name : The author name
    • link : A link to the author
    • icon : A link to the icon picture

Telegram

How to create it ?

You need 2 things: the bot token (who send the message) and the chat id (where send it).

  1. The bot token :
  • DM @BotFather
  • Do /start
  • Answer to questions
  • Do /token
  • Here you have the token ! Now use it and keep it safely.
  1. The chat id : You can lot of way to do get it, but mostly you can invite bot that said the ID. For example @raw_data_bot

It failed to send message to the given ID.

  • Check by going to https://api.telegram.org/bot<TOKEN>/getme. If you have good result, the issue is from the chat id.
  • Try with "-" or "+" at begin of chat id. If can help to find if it's a personnal discussion or group one.

Common behavior of all message type

In writing...

All placeholders

General ones

You can use some placeholders in all messages :

%name% : Name of the player which procude the message
%uuid% : UUID of the player which procude the message
%ip% : IP of the player which produce the message
%date% : Date when the player procude the message
%sender% : The sender of the message (such as banner or reporter)
%ping% : The ping of the player
%world% : The world of the player
%server_name% : The name of the server where the player is
%server_version% : Version of the server
%player_version% : Version of the player
%tps% : Actual server TPS

Alert

For alert, there is a specific content possible: content_first. It's the content message, but showed only for the first time the player create webhook. It's made to write specific message, tag some roles or users. If not present, the content message will be used.

Placeholders available for alert message only :

  • %cheat% : the cheat name
  • %amount% : Amount of alert made by player
  • %reliability% : Reliability of the cheat

Ban

Placeholders available for report message only :

  • %reason% : The reason of the ban

Kick

Placeholders available for kick message only :

  • %reason% : Name of the banned player

Report

Placeholders available for report message only :

  • %reason% : Name of the banned player

Need new webhook ?

You can ask for new webhook support.