|
NWNX:EE
8193.36.12
|
|
Go to the documentation of this file. 1 #include "nwnx_webhook"
61 string IntToBoolString(
int iBool);
72 string IntToBoolString(
int iBool)
74 return iBool == 0 ?
"false" :
"true";
79 if (host ==
"discordapp.com" && GetStringRight(path, 6) !=
"/slack")
81 PrintString(
"Discord WebHook specified but path does not end with /slack");
88 string sMainText =
"";
91 if (stMessage.
sText !=
"")
93 if (host ==
"discordapp.com" && !mrkdwn)
94 sMainText =
"```text\\n" + stMessage.
sText +
"```";
96 sMainText = stMessage.
sText;
98 message = message +
"\"text\": \"" + sMainText +
"\"";
101 if (host !=
"discordapp.com" && !mrkdwn)
102 message = message +
",\"mrkdwn\": false";
106 message = message +
",\"username\": \"" + stMessage.
sUsername +
"\"";
108 message = message +
",\"icon_url\": \"" + stMessage.
sAvatarURL +
"\"";
116 message = message +
",\"attachments\": [{\"author_name\": \"" + stMessage.
sAuthorName +
"\",\"author_link\": \"" + stMessage.
sAuthorURL +
117 "\",\"author_icon\": \"" + stMessage.
sAuthorIconURL +
"\",\"title\": \"" + stMessage.
sTitle +
"\",\"title_link\": \"" + stMessage.
sURL +
120 "\",\"image_url\": \"" + stMessage.
sImageURL +
"\"";
124 message = message +
",\"ts\": \"" + IntToString(stMessage.
iTimestamp) +
"\"";
129 message = message +
",\"fields\": [";
132 message = message +
",{\"title\": \"" + stMessage.
sField2Name +
"\",\"value\": \"" + stMessage.
sField2Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField2Inline) +
"}";
134 message = message +
",{\"title\": \"" + stMessage.
sField3Name +
"\",\"value\": \"" + stMessage.
sField3Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField3Inline) +
"}";
136 message = message +
",{\"title\": \"" + stMessage.
sField4Name +
"\",\"value\": \"" + stMessage.
sField4Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField4Inline) +
"}";
138 message = message +
",{\"title\": \"" + stMessage.
sField5Name +
"\",\"value\": \"" + stMessage.
sField5Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField5Inline) +
"}";
140 message = message +
",{\"title\": \"" + stMessage.
sField6Name +
"\",\"value\": \"" + stMessage.
sField6Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField6Inline) +
"}";
142 message = message +
",{\"title\": \"" + stMessage.
sField7Name +
"\",\"value\": \"" + stMessage.
sField7Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField7Inline) +
"}";
144 message = message +
",{\"title\": \"" + stMessage.
sField8Name +
"\",\"value\": \"" + stMessage.
sField8Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField8Inline) +
"}";
146 message = message +
",{\"title\": \"" + stMessage.
sField9Name +
"\",\"value\": \"" + stMessage.
sField9Value +
"\",\"short\": " + IntToBoolString(stMessage.
iField9Inline) +
"}";
150 message = message +
"]";
153 message = message +
"}]";
156 message = message +
"}";
string sField1Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iField3Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sThumbnailURL
https://birdie0.github.io/discord-webhooks-guide/structure/embed/thumbnail.html
int iField2Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iField6Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField7Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sFooterURL
https://birdie0.github.io/discord-webhooks-guide/structure/embed/footer.html
string sFooterText
https://birdie0.github.io/discord-webhooks-guide/structure/embed/footer.html
string sField9Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField6Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField4Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iField1Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField6Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sUsername
https://birdie0.github.io/discord-webhooks-guide/structure/username.html
For more information on these fields see https://birdie0.github.io/discord-webhooks-guide/.
string sField5Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField3Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sTitle
https://birdie0.github.io/discord-webhooks-guide/structure/embed/title.html
int iField8Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField8Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iField9Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField2Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField10Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField3Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sURL
https://birdie0.github.io/discord-webhooks-guide/structure/embed/url.html
int iField10Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iField7Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iTimestamp
https://birdie0.github.io/discord-webhooks-guide/structure/embed/timestamp.html
string sField9Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sText
https://birdie0.github.io/discord-webhooks-guide/structure/content.html
string sField7Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iField4Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField10Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField8Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string NWNX_WebHook_BuildMessageForWebHook(string host, string path, struct NWNX_WebHook_Message stMessage, int mrkdwn=1)
Builds and sends a rich webhook message based on the constructed NWNX_WebHook_Message.
string sField1Value
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sAuthorURL
https://birdie0.github.io/discord-webhooks-guide/structure/embed/author.html
string sField2Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
int iField5Inline
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sField4Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
string sAuthorIconURL
https://birdie0.github.io/discord-webhooks-guide/structure/embed/author.html
string sAuthorName
https://birdie0.github.io/discord-webhooks-guide/structure/embed/author.html
string sColor
https://birdie0.github.io/discord-webhooks-guide/structure/embed/color.html
string sDescription
https://birdie0.github.io/discord-webhooks-guide/structure/embed/description.html
string sImageURL
https://birdie0.github.io/discord-webhooks-guide/structure/embed/image.html
string sAvatarURL
https://birdie0.github.io/discord-webhooks-guide/structure/avatar_url.html
string sField5Name
https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html