Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions bot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ local client = discordia.Client({
})

local function code(str)
return string.format('```\n%s```', str)
return string.format('```\n%s```', str)
end

local function printLine(...)
local ret = {}
for i = 1, select('#', ...) do
local arg = tostring(select(i, ...))
table.insert(ret, arg)
end
return table.concat(ret, '\t')
local ret = {}
for i = 1, select('#', ...) do
local arg = tostring(select(i, ...))
table.insert(ret, arg)
end
return table.concat(ret, '\t')
end

dofile("utils.lua")
Expand Down Expand Up @@ -129,7 +129,7 @@ Bot.ConfigTypeToString = {
}

Bot.ConfigTypeParameter = {
[Bot.ConfigType.Boolean] = function (value, guild)
[Bot.ConfigType.Boolean] = function (value, guild)
if (value == "yes" or value == "1" or value == "true") then
return true
elseif (value == "no" or value == "0" or value == "false") then
Expand All @@ -151,7 +151,7 @@ Bot.ConfigTypeParameter = {
[Bot.ConfigType.Channel] = function (value, guild)
return Bot:DecodeChannel(guild, value)
end,
[Bot.ConfigType.Custom] = function (value, guild)
[Bot.ConfigType.Custom] = function (value, guild)
return nil
end,
[Bot.ConfigType.Duration] = function (value, guild)
Expand All @@ -168,7 +168,7 @@ Bot.ConfigTypeParameter = {
if not success then
return nil, err
end

local guild = client:getGuild(value)
if not guild then
return nil, value .. " is not a guild I know"
Expand Down Expand Up @@ -197,7 +197,7 @@ Bot.ConfigTypeParameter = {
}

Bot.ConfigTypeParser = {
[Bot.ConfigType.Boolean] = function (value, guild)
[Bot.ConfigType.Boolean] = function (value, guild)
if (value == "yes" or value == "1" or value == "true") then
return true
elseif (value == "no" or value == "0" or value == "false") then
Expand All @@ -220,7 +220,7 @@ Bot.ConfigTypeParser = {
local channel = Bot:DecodeChannel(guild, value)
return channel and channel.id
end,
[Bot.ConfigType.Custom] = function (value, guild)
[Bot.ConfigType.Custom] = function (value, guild)
return nil
end,
[Bot.ConfigType.Duration] = function (value, guild)
Expand All @@ -238,7 +238,7 @@ Bot.ConfigTypeParser = {
if not success then
return nil, err
end

local guild = client:getGuild(value)
if not guild then
return nil, value .. " is not a guild I know"
Expand Down
3 changes: 2 additions & 1 deletion deps/discordia/libs/client/Client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ local function run(self, token)

local user, err1 = api:authenticate(token)
if not user then
return self:error('Could not authenticate, check token: ' .. err1)
self:error('Could not authenticate, check token: ' .. err1)
os.exit(0)
end
self._user = users:_insert(user)
self._token = token
Expand Down