A discord webhook addon using basic SQF/Arma configs so even beginners can easily send webhook messages directly from an Arma 3 Server.
- 2-step installation
- Design embeds how you want in Arma config format
- Use SQF parameters for dynamic text content
- You may need to install .NET Framework 4.5.2.
- The extensions were built and tested on Arma 3 Dedicated Server.
- This addon does work on Arma client however the extensions are NOT BattlEye whitelisted.
The following instructions are for an Arma 3 Server using the latest release.
- Place
@DiscordEmbedBuilder
in your server root folder - Add the mod to your command line
-serverMod=@DiscordEmbedBuilder
The config is where you design your messages. There are quite a few settings for the each message which are explained below.
webhookurl
- Unique URL provided by Discord. It determines what channel your message will send to.message
- The text content of your message. This example usesThis is an example message
.username
- The name of the bot when it sends the message. If this is not set Discord will use the name set in the webhook settings.avatar
- The avatar of the bot when it sends the message. If this is not set Discord will use the image set in the webhook settings.tts
- Text to speech.
That's all you need to send a simple text message, however there are more settings to configure embeds.
Messages can contain up to 10 embeds. These embeds must be defined inside the Embeds
subclass.
CfgDiscordEmbedTemplate
Example2.cpp
title
- Embed title text.description
- Description text, located under the title.url
- Link opened when you click the title text.color
- RGB color code. eg: Red FF0000.timestamp
- Show timestamp in the embed footer.thumbnail
- Image shown in the top right corner of the embed.image
- Full embed width image shown at the bottom of the embed under all fields.fields
- Array of embed fields. Maximum of 25 fields per embed.
name
- Author name, located above the title text.url
- Link opened when you click the author name.image
- Tiny image shown to the left of the author name.
text
- Footer text, shown to the left of the timestamp (if enabled).image
- Small image shown to the left of the footer text.
The SQF side of this mod is very minimal. You don't need to edit the sqf files in the mod pbo at all as the customization is all done in the config file.
What you do need to know is how to execute the webhook, which is very simple.
[type,parameters] call DiscordEmbedBuilder_fnc_send;
- Type: STRING - The name of the config class in
CfgDiscordEmbedBuilder
you wish to use. - Parameters: ARRAY (optional) - Any value you want to use in the embed.
Parameters are used in message
, username
, embed title
, embed description
, author name
, footer text
, field name
and field content
with the format
command:
format([string]+parameters);
- Open your Discord client and open the settings of the channel you want your message to send to.
- Click
Webhooks
on the left panel, then clickCreate Webhook
. - Scroll down to
Webhook URL
, clickCopy
. - Paste the URL in your
webhookurl
config property and remove the base URL.https://discordapp.com/api/webhooks/
00000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Here is a video tutorial showing how to set up your webhook. There is no audio to it but it shows you exactly what to do.
https://www.youtube.com/watch?v=yF0UEiUnL9E