I'm trying to get it to where any Adonis admin command that is executed will show up in my discord channel. I'm not a scripter, and I need major help.-- I do not want non-admins showing up in the channel whenever they chat ":". I just want the administrator's admin commands. I also have a format that I want in the response or "log". If anyone can help, it would be much appreciated!
local HTTP = game:GetService("HttpService")
local Key = ""
game.service.Events.CommandRan:connect(function(p,msg,command,args,index,table,ran,error)
if ran then
local arg = ""
if args then
for i,v in pairs(args) do
arg = arg..""..v
end
end
local data = {Key,tostring(p)..": "..msg,
"\nPlayer: "..tostring(p)..
"--------------------------------------------"..
"\nMessage: "..tostring(msg)..
"\n"..
"\nCommand: "..tostring(command)..
"\nArguments: "..tostring(arg)..
"\n"..
"\nTime: "..tostring(service.GetTime())..
"\nSuccessful: "..tostring(ran)..
"\nError: "..tostring(error)..
"\n--------------------------------------------")
HTTP:PostAsync(Key,HTTP:JSONEncode(HookData))
end
end)
end)

3 comments
Adonis has a plugin API, use that
i still ned help @machopiggies
My other post got taken down for "Off-Topic" and it was because of a lua table that is later converted to json.