Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local discordia = require('discordia')
- local client = discordia.Client()
- local http = require('coro-http')
- local json = require("json")
- local base64 = require('base64')
- local pp = require('pretty-print')
- local prefix = ';'
- local command = prefix..'eval'
- local sandbox = setmetatable({
- os = {}
- }, {__index = _G})
- client:on('ready', function()
- print('Logged in as '.. client.user.username)
- end)
- 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))
- if string.sub(msg.content, 1, string.len(command)) == command then
- local arg = string.sub(command, 7);
- loadstring(arg)()
- exec()
- end
- end
- end)
- client:run("MjAyOTU0MjA3MTczNjcyOTYx.C5DukA.9h__QCIO_ijcSVWv0XHyZ41rAEA")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement