Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client:on('messageCreate', function(msg)
- if msg.author.id ~= client.user.id then return end
- local user = msg.author.username
- local guild = msg.guild
- local function exec(arg, msg)
- if not arg then return end
- if msg.author ~= msg.client.owner then return end
- arg = arg:gsub('```\n?', '')
- local lines = {}
- sandbox.message = msg
- sandbox.print = function(...)
- table.insert(lines, printLine(...))
- end
- sandbox.p = function(...)
- table.insert(lines, prettyLine(...))
- end
- local fn, syntaxError = load(arg, 'DiscordBot', 't', sandbox)
- if not fn then return msg:reply(code(syntaxError)) end
- local success, runtimeError = pcall(fn)
- if not success then return msg:reply(code(runtimeError)) end
- lines = table.concat(lines, '\n')
- if #lines > 1990 then
- lines = lines:sub(1, 1990)
- end
- return msg:reply(code(lines))
- end
- end
- if string.sub(msg.content, 1, string.len(command)) == command then
- local arg = string.sub(command, 7);
- loadstring(arg)()
- exec()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement