41 lines
No EOL
1.2 KiB
Text
41 lines
No EOL
1.2 KiB
Text
#include "Common.lsl"
|
|
|
|
|
|
|
|
SendUserMessage(string sMessage, integer iError) {
|
|
integer iUseTitle=1;
|
|
if(llStringLength(sMessage) > 255) iUseTitle=0;
|
|
|
|
string sJson = llList2Json(JSON_OBJECT, [
|
|
"content", JSON_NULL,
|
|
"attachments", llList2Json(JSON_ARRAY, []),
|
|
"username", "Farm Servers",
|
|
"avatar_url", "https://media.discordapp.net/attachments/836451385733021706/1238977979141591081/second-life-icon-25-3810850605.png?ex=66413fa9&is=663fee29&hm=f92e5dceb842992fcc56cfde3dce306da91412eb12f3ca8ebfab4ed2c163115a&=&format=webp&quality=lossless&width=500&height=500",
|
|
"embeds", llList2Json(JSON_ARRAY, [
|
|
llList2Json(JSON_OBJECT, [
|
|
"footer", llList2Json(JSON_OBJECT, [
|
|
"text", "Aria's Creations Discord Relay v" + VERSION
|
|
]),
|
|
"timestamp", llGetTimestamp()
|
|
])
|
|
])
|
|
]);
|
|
|
|
if(iUseTitle)
|
|
sJson = llJsonSetValue(sJson, ["embeds", 0, "title"], sMessage);
|
|
else sJson = llJsonSetValue(sJson, ["embeds", 0, "description"], sMessage);
|
|
|
|
llHTTPRequest(g_sNotifyURL, [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/json"], sJson);
|
|
|
|
llSay(0, "Message Sent!");
|
|
}
|
|
|
|
|
|
|
|
default
|
|
{
|
|
state_entry()
|
|
{
|
|
|
|
}
|
|
} |