2021-11-26 16:38:17 +00:00
|
|
|
package.path = "./libraries/?.lua;./libraries/?/init.lua;"..package.path
|
2022-04-09 19:22:33 +00:00
|
|
|
package.cpath = "./libraries/?.so;"..package.cpath
|
2021-11-26 16:38:17 +00:00
|
|
|
|
|
|
|
--load discordia
|
|
|
|
discordia = require("discordia")
|
|
|
|
client = discordia.Client()
|
|
|
|
|
|
|
|
--activate the import system
|
|
|
|
local import = require("import")(require)
|
|
|
|
|
2022-05-08 15:26:52 +00:00
|
|
|
local server_ids = {
|
|
|
|
"640251445949759499"
|
|
|
|
}
|
2022-04-08 20:55:30 +00:00
|
|
|
local servers = {}
|
2022-02-21 13:42:30 +00:00
|
|
|
|
2021-11-26 16:38:17 +00:00
|
|
|
--create server
|
|
|
|
local server = import("classes.server-handler")
|
|
|
|
client:on("ready",function()
|
|
|
|
print("starting test")
|
2022-05-08 15:26:52 +00:00
|
|
|
for _,id in pairs(server_ids) do
|
|
|
|
if not servers[id] then
|
|
|
|
servers[id] = server(client,client:getGuild(id),{
|
|
|
|
path = os.getenv("HOME").."/bot-savedata/"..id.."/",
|
|
|
|
autosave_frequency = 20,
|
|
|
|
default_plugins = {
|
|
|
|
"meta",
|
|
|
|
"help",
|
|
|
|
"plugins",
|
|
|
|
"esolang",
|
|
|
|
"tools",
|
|
|
|
"reactions",
|
|
|
|
"roledefaults",
|
|
|
|
"security",
|
|
|
|
"cron"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
2022-02-21 13:42:30 +00:00
|
|
|
end
|
2021-11-26 16:38:17 +00:00
|
|
|
end)
|
|
|
|
|
2022-02-21 13:42:30 +00:00
|
|
|
|
2021-11-26 16:38:17 +00:00
|
|
|
--load token
|
|
|
|
local tempfile = io.open("./token","r")
|
|
|
|
if not tempfile then
|
|
|
|
error("./token file does not exist")
|
|
|
|
end
|
|
|
|
local nstr = tempfile:read("*l")
|
|
|
|
tempfile:close()
|
|
|
|
client:run('Bot '..nstr)
|