From f0cbd286e5bff803e486a56b09799e9eced376a2 Mon Sep 17 00:00:00 2001 From: 9382 Date: Mon, 13 Mar 2023 16:05:35 +0000 Subject: [PATCH] More in-depth tracebacks upon command failure --- src/main.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.lua b/src/main.lua index 82bca67..14825c3 100644 --- a/src/main.lua +++ b/src/main.lua @@ -66,11 +66,16 @@ client:on('messageCreate', function(message) local command=commands.command_list[cmdName] if command~=nil then if message.guild~=nil then - local s,e=pcall(function() + local tb + local s,e=xpcall(function() command.exec({message=message,args=args,mentions=mentions,t={client,discordia,token}}) + end,function(err) + tb = debug.traceback() + return err end) if not s then message:reply('tripped : '..e:split('/')[#e:split('/')]) + print(e,tb) end end end