Added basic ping pong bot

Requires a config.json file with a token
This commit is contained in:
benji7425 2016-10-29 18:31:16 +01:00
parent b6c4e08737
commit 7f65c0c117
2 changed files with 23 additions and 0 deletions

2
.gitignore vendored
View File

@ -53,3 +53,5 @@ jspm_packages
# Output of 'npm pack'
*.tgz
/config.json

21
feed-bot.js Normal file
View File

@ -0,0 +1,21 @@
var Discord = require("discord.io");
var Config = require("./config.json");
var console = require("console");
var bot = new Discord.Client({
token: Config.token,
autorun: true
});
bot.on("ready", function () {
console.log(bot.username + " - (" + bot.id + ")");
});
bot.on("message", function (user, userID, channelID, message) {
if (message === "ping") {
bot.sendMessage({
to: channelID,
message: "pong"
});
}
});