@ -1,15 +1,19 @@
local tools = dofile ( " ./API/tools.lua " )
local tools = dofile ( " ./API/tools.lua " )
local rng = dofile ( " ./API/rng.lua " )
local rng = dofile ( " ./API/rng.lua " )
local complexCommands = { }
local complexCommands = { }
local prefix = dofile ( " ./docs/key.lua " )
local prefix = dofile ( " ./docs/settings.lua " )
local commands = { -- Define commands its a table that will contain our commands
local commands = { -- Define commands its a table that will contain our commands
[ prefix .. ' helpme ' ] = { -- Dumps docs/help to chat, took me forever to figure out.
[ prefix .. ' helpme ' ] = { -- Dumps docs/help to chat, took me forever to figure out.
exec = function ( message )
exec = function ( message )
if tools.testModeDetection ( ) == true then
message.channel : send ( tools.printFile ( " docs/helpTestMode " ) )
else
message.channel : send ( tools.printFile ( " docs/help " ) )
message.channel : send ( tools.printFile ( " docs/help " ) )
end
end
end
} ;
} ;
[ prefix .. ' roll ' ] = { -- Rolls a d20, check RNG for more info.
[ prefix .. ' roll ' ] = { -- Rolls a d20, check RNG for more info.
exec = function ( message , arg )
exec = function ( message , arg )
if not arg [ 2 ] then
if not arg [ 2 ] then
@ -19,6 +23,7 @@ local commands = { -- Define commands its a table that will contain our commands
end
end
end
end
} ;
} ;
--[[
--[[
[ prefix .. ' figlet ' ] = { -- Parrots input to figlet, then echos it to the same channel you are in.
[ prefix .. ' figlet ' ] = { -- Parrots input to figlet, then echos it to the same channel you are in.
exec = function ( message )
exec = function ( message )
@ -30,6 +35,7 @@ local commands = { -- Define commands its a table that will contain our commands
message : delete ( )
message : delete ( )
end
end
} ;
} ;
[ prefix .. ' cowsay ' ] = { -- Parrots input to cowsay, then echos it to the same channel you are in.
[ prefix .. ' cowsay ' ] = { -- Parrots input to cowsay, then echos it to the same channel you are in.
exec = function ( message )
exec = function ( message )
local prefixLength = string.len ( prefix )
local prefixLength = string.len ( prefix )
@ -47,10 +53,25 @@ local commands = { -- Define commands its a table that will contain our commands
local echo = string.sub ( message.content , 5 + prefixLength )
local echo = string.sub ( message.content , 5 + prefixLength )
local echoed = tools.echo ( echo )
local echoed = tools.echo ( echo )
local result = " ```fix " .. " \n " .. echoed .. " ``` "
local result = " ```fix " .. " \n " .. echoed .. " ``` "
if result == " ```fix \n ``` " then message : delete ( ) return
else
message.channel : send ( result )
message.channel : send ( result )
message : delete ( )
message : delete ( )
end
end
end
} ;
} ;
[ prefix .. ' echoclean ' ] = { -- Echo's what you said back out, in a fix codeblock. Could be against TOS.
exec = function ( message )
local prefixLength = string.len ( prefix )
local echo = string.sub ( message.content , 10 + prefixLength )
local echoed = tools.echo ( echo )
local result = echoed
message.channel : send ( result )
message : delete ( )
end
} ;
}
}
function complexCommands . initialize ( )
function complexCommands . initialize ( )