|
|
|
@ -2,8 +2,9 @@ local discordia = require('discordia')
|
|
|
|
|
local client = discordia.Client()
|
|
|
|
|
seed = os.time()
|
|
|
|
|
math.randomseed(seed)
|
|
|
|
|
tabletest = {Hello, Hi, Lol}
|
|
|
|
|
|
|
|
|
|
function messageDectection (message, search)
|
|
|
|
|
function messageDectection(message, search)
|
|
|
|
|
distinctMessage = message.content
|
|
|
|
|
key = "!"
|
|
|
|
|
keyedSearch = key .. search
|
|
|
|
@ -11,10 +12,17 @@ function messageDectection (message, search)
|
|
|
|
|
return true
|
|
|
|
|
else
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function printFile(file)
|
|
|
|
|
rawFile = io.open(file, r)
|
|
|
|
|
message = rawFile:read("*all")
|
|
|
|
|
rawFile:close()
|
|
|
|
|
return message
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
client:on('ready', function()
|
|
|
|
|
print('Logged in as '.. client.user.username)
|
|
|
|
|
end)
|
|
|
|
@ -25,6 +33,12 @@ client:on('messageCreate', function(message)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
client:on('messageCreate', function(message)
|
|
|
|
|
if messageDectection(message, "ThemHelp") == true then
|
|
|
|
|
message.channel:send(printFile("docs/help"))
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
client:on('messageCreate', function(message)
|
|
|
|
|
if messageDectection(message, "roll") == true then
|
|
|
|
|
dice = math.random(20)
|
|
|
|
|