commit 636b989184eeecb5fbfb31c4a606667a2bf8222a Author: Celeste Date: Thu Nov 3 18:55:00 2022 +0000 add the shtuff diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7c8460 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +deps/ +discordia.log +gateway.json +token.txt diff --git a/bot.lua b/bot.lua new file mode 100644 index 0000000..f0939aa --- /dev/null +++ b/bot.lua @@ -0,0 +1,17 @@ +local discordia = require('discordia') +local client = discordia.Client() + +client:on('ready', function() + print('Logged in as '.. client.user.username) +end) + +client:on('messageCreate', function(message) + if message.content == '.ping' then + message.channel:send('Pong!') + end +end) + +local f = io.open("token.txt", "r") +local token = f:read("*a") +f:close() +client:run('Bot ' .. token:gsub("\n",""))