Skip to content

Commit

Permalink
Updated API url to discord.com as discordapp.com will be disabled in …
Browse files Browse the repository at this point in the history
…November
  • Loading branch information
ConnorAU committed Aug 2, 2020
1 parent 11d5c6f commit b8927e2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Copyright (c) 2019 ConnorAU
Steam: https://steamcommunity.com/id/_connor
Github: https://github.com/ConnorAU
Copyright (c) 2020 ConnorAU
Github: https://github.com/ConnorAU/SQFDiscordEmbedBuilder
Discord: https://discord.gg/DMkxetD

1. You are permitted to:
Expand All @@ -14,4 +13,4 @@ Copyright (c) 2019 ConnorAU
a. All credit attribution to the original author must remain unmodified

4. Disclaimer:
a. This material is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the material or the use or other dealings in the material.
a. This material is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the material or the use or other dealings in the material.
4 changes: 2 additions & 2 deletions addon/external/Example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ class Example {
webhook="Example"; // CfgDiscordEmbedWebhooks
message="This is an example message";
username="Example Name";
avatar="https://discordapp.com/assets/2c21aeda16de354ba5334551a883b481.png";
avatar="https://discord.com/assets/2c21aeda16de354ba5334551a883b481.png";
tts=0;
};
};
4 changes: 2 additions & 2 deletions addon/external/Example2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Example2 {
webhook="Example"; // CfgDiscordEmbedWebhooks
message="This is another example message";
username="Different username, same webhook";
avatar="https://discordapp.com/assets/28174a34e77bb5e5310ced9f95cb480b.png";
avatar="https://discord.com/assets/28174a34e77bb5e5310ced9f95cb480b.png";
tts=0;
// Maximum of 10 embeds per template
class Embeds {
Expand All @@ -22,7 +22,7 @@ class Example2 {
class Footer {
text="This is the footer text";
image="https://steamcdn-a.opskins.media/steamcommunity/public/images/apps/107410/3212af52faf994c558bd622cb0f360c1ef295a6b.jpg";
};
};
fields[]={
//{title,content,inline}
{"Field 1","Content 1",1},
Expand Down
6 changes: 3 additions & 3 deletions addon/external/_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Developer info: https://github.com/ConnorAU/SQFDiscordEmbedBuilder/blob/master/README.md

class CfgDiscordEmbedWebhooks {
// https://discordapp.com/api/webhooks/000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// https://discord.com/api/webhooks/000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Example="000000000000000000/XXXXXXX_XXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
};

Expand All @@ -29,7 +29,7 @@ class CfgDiscordEmbedTemplate {
class Footer {
text="";
image="";
};
};
// Maximum 25 fields per embed
fields[]={
//{title,content,inline}
Expand All @@ -39,4 +39,4 @@ class CfgDiscordEmbedTemplate {
class CfgDiscordEmbedBuilder {
#include "\@DiscordEmbedBuilder\external\Example.cpp"
#include "\@DiscordEmbedBuilder\external\Example2.cpp"
};
};
2 changes: 1 addition & 1 deletion addon/pbo/fn_buildSqf.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Example 1:
"Example",
"This is an example message",
"Example Name",
"https://discordapp.com/assets/2c21aeda16de354ba5334551a883b481.png",
"https://discord.com/assets/2c21aeda16de354ba5334551a883b481.png",
false
] call DiscordEmbedBuilder_fnc_buildSqf;
Expand Down
2 changes: 1 addition & 1 deletion extension/DiscordEmbedBuilder/Discord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal static async Task HandleRequest(string[] args)
// Execute webhook
using (HttpClient APIClient = new HttpClient())
{
APIClient.BaseAddress = new Uri("https://discordapp.com/api/webhooks/");
APIClient.BaseAddress = new Uri("https://discord.com/api/webhooks/");
APIClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await APIClient.PostAsync(url, new StringContent(JsonConvert.SerializeObject(package), Encoding.UTF8, "application/json"));
await Tools.LogAsyncReply(response.Content);
Expand Down

0 comments on commit b8927e2

Please sign in to comment.