Basic IO, help unfinished

pull/1/head
Astoria Floyd 3 years ago
parent 6bc2a2fa1a
commit 22581c242b

@ -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)

@ -0,0 +1,3 @@
Hello!
Line 2
Line 3!
Loading…
Cancel
Save