Adds discord relay plugin

This commit is contained in:
zontreck 2024-07-17 01:52:04 -07:00
parent 6ad891e5ac
commit 5674233bf8
5 changed files with 65 additions and 46 deletions

View file

@ -0,0 +1,28 @@
/*
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);
}
}
}