diff --git a/README.md b/README.md index 86805d7..2a72bb7 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ A discord webhook addon using basic SQF/Arma configs so even beginners can easil ## Note - You may need to install [.NET Framework 4.5.2](https://www.microsoft.com/en-au/download/details.aspx?id=42642). -- 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. +- This addon was built, tested and intended for use on Arma 3 Dedicated Server. # Setup The following instructions are for an Arma 3 Server using the latest [release](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/releases). @@ -25,9 +24,9 @@ The following instructions are for an Arma 3 Server using the latest [release](h The config is where you design message templates. The idea with templates is you can write up the structure of your message in the config, and use that structure in multiple scripts. There are quite a few settings for the each message which are explained below. ### Basic settings -[Example.cpp](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/embeds/Example.cpp) +[Example.cpp](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/external/Example.cpp) -- `webhook` - [CfgDiscordEmbedWebhooks](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/config.cpp#L35) identifier. +- `webhook` - [CfgDiscordEmbedWebhooks](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/external/_config.cpp#L9) identifier. - `message` - The text content of your message. This example uses `This is an example message`.
![](https://i.imgur.com/x80hA14.png) - `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. @@ -37,8 +36,8 @@ That's all you need to send a simple text message, however there are more settin ### Embed settings Messages can contain up to 10 embeds. These embeds must be defined inside the `Embeds` subclass. -[CfgDiscordEmbedTemplate](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/config.cpp)
-[Example2.cpp](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/embeds/Example2.cpp) +[CfgDiscordEmbedTemplate](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/external/_config.cpp#L14)
+[Example2.cpp](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/external/Example2.cpp) - `title` - Embed title text. - `description` - Description text, located under the title. - `url` - Link opened when you click the title text. @@ -76,7 +75,7 @@ format([string]+parameters); ### Build with SQF You can build entire messages in SQF if you prefer that to configs. I suggest only using it for simple messages, however the system has full support for all the same settings as config templates so you can do what you like. -[SQF Examples](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/fn_buildSqf.sqf#L10) +[SQF Examples](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/pbo/fn_buildSqf.sqf#L10) ```sqf [ @@ -126,7 +125,7 @@ You can build entire messages in SQF if you prefer that to configs. I suggest on 1. Open your Discord client and open the settings of the channel you want your message to send to.
![Step 1](https://i.imgur.com/hFZ2bHw.png) 2. Click `Webhooks` on the left panel, then click `Create Webhook`.
![Step 2](https://i.imgur.com/8KJXkl4.png) 3. Scroll down to `Webhook URL`, click `Copy`.
![Step 3](https://i.imgur.com/l4gpTxP.png) -4. Create a unique property inside [CfgDiscordEmbedWebhooks](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/config.cpp#L35) and remove the base URL. +4. Create a unique property inside [CfgDiscordEmbedWebhooks](https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/addon/external/_config.cpp#L9) and remove the base URL. ```cpp class CfgDiscordEmbedWebhooks { // https://discordapp.com/api/webhooks/000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX diff --git a/addon/embeds/Example.cpp b/addon/external/Example.cpp similarity index 100% rename from addon/embeds/Example.cpp rename to addon/external/Example.cpp diff --git a/addon/embeds/Example2.cpp b/addon/external/Example2.cpp similarity index 100% rename from addon/embeds/Example2.cpp rename to addon/external/Example2.cpp diff --git a/addon/config.cpp b/addon/external/_config.cpp similarity index 69% rename from addon/config.cpp rename to addon/external/_config.cpp index 9d47d97..5892472 100644 --- a/addon/config.cpp +++ b/addon/external/_config.cpp @@ -6,6 +6,11 @@ │ Please do not modify or remove this comment block │ └──────────────────────────────────────────────────────*/ +class CfgDiscordEmbedWebhooks { + // https://discordapp.com/api/webhooks/000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + Example="000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; +}; + class CfgDiscordEmbedTemplate { title=""; description=""; @@ -28,38 +33,8 @@ class CfgDiscordEmbedTemplate { //{title,content,inline} }; }; -class CfgDiscordEmbedBuilder { - #include "embeds\Example.cpp" - #include "embeds\Example2.cpp" -}; -class CfgDiscordEmbedWebhooks { - // https://discordapp.com/api/webhooks/000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - Example="000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; -}; - - -// You don't need to worry about this stuff -class CfgPatches { - class DiscordEmbedBuilder { - name="DiscordEmbedBuilder"; - author="Connor"; - url="https://steamcommunity.com/id/_connor"; - - requiredVersion=1.68; - requiredAddons[]={}; - units[]={}; - weapons[]={}; - }; -}; -class CfgFunctions { - class DiscordEmbedBuilder { - class Scripts { - file = "\DiscordEmbedBuilder"; - class init {preInit=1;}; - class buildCfg {}; - class buildSqf {}; - class send {}; - }; - }; +class CfgDiscordEmbedBuilder { + #include "\@DiscordEmbedBuilder\external\Example.cpp" + #include "\@DiscordEmbedBuilder\external\Example2.cpp" }; \ No newline at end of file diff --git a/addon/pbo/$PBOPREFIX$ b/addon/pbo/$PBOPREFIX$ new file mode 100644 index 0000000..4deed72 --- /dev/null +++ b/addon/pbo/$PBOPREFIX$ @@ -0,0 +1 @@ +DiscordEmbedBuilder \ No newline at end of file diff --git a/addon/pbo/config.cpp b/addon/pbo/config.cpp new file mode 100644 index 0000000..a9f49c1 --- /dev/null +++ b/addon/pbo/config.cpp @@ -0,0 +1,33 @@ +/*──────────────────────────────────────────────────────┐ +│ Author: Connor │ +│ Steam: https://steamcommunity.com/id/_connor │ +│ Github: https://github.com/ConnorAU │ +│ │ +│ Please do not modify or remove this comment block │ +└──────────────────────────────────────────────────────*/ + +// You don't need to worry about this stuff +#include "\@DiscordEmbedBuilder\external\_config.cpp" +class CfgPatches { + class DiscordEmbedBuilder { + name="DiscordEmbedBuilder"; + author="Connor"; + url="https://steamcommunity.com/id/_connor"; + + requiredVersion=1.68; + requiredAddons[]={}; + units[]={}; + weapons[]={}; + }; +}; +class CfgFunctions { + class DiscordEmbedBuilder { + class Scripts { + file = "\DiscordEmbedBuilder"; + class init {preInit=1;}; + class buildCfg {}; + class buildSqf {}; + class send {}; + }; + }; +}; \ No newline at end of file diff --git a/addon/fn_buildCfg.sqf b/addon/pbo/fn_buildCfg.sqf similarity index 100% rename from addon/fn_buildCfg.sqf rename to addon/pbo/fn_buildCfg.sqf diff --git a/addon/fn_buildSqf.sqf b/addon/pbo/fn_buildSqf.sqf similarity index 100% rename from addon/fn_buildSqf.sqf rename to addon/pbo/fn_buildSqf.sqf diff --git a/addon/fn_init.sqf b/addon/pbo/fn_init.sqf similarity index 100% rename from addon/fn_init.sqf rename to addon/pbo/fn_init.sqf diff --git a/addon/fn_send.sqf b/addon/pbo/fn_send.sqf similarity index 100% rename from addon/fn_send.sqf rename to addon/pbo/fn_send.sqf