FarmSystem/LSL/raw/plugin_discord.lsl

28 lines
No EOL
726 B
Text

/*
Discord Relay Plugin
*/
#include "Common.lsl"
default
{
state_entry()
{
llListen(0x9CB9, "", "", "");
}
listen(integer c,string n,key i, string m) {
if(llGetOwnerKey(i) == llGetOwner()) {
llMessageLinked(LINK_SET, 888, llList2Json(JSON_OBJECT, [
"system", FALSE,
"message", llList2Json(JSON_OBJECT, [
"username", llJsonGetValue(m, ["user"]),
"content", llJsonGetValue(m, ["msg"]),
"color", 2067276,
"author", llJsonGetValue(m, ["author"]),
"title", llJsonGetValue(m,["title"])
])
]), NULL_KEY);
}
}
}