From 636b989184eeecb5fbfb31c4a606667a2bf8222a Mon Sep 17 00:00:00 2001 From: Celeste Date: Thu, 3 Nov 2022 18:55:00 +0000 Subject: [PATCH] add the shtuff --- .gitignore | 4 ++++ bot.lua | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 .gitignore create mode 100644 bot.lua 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",""))