mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 12:40:50 +00:00
removed cat api example
This commit is contained in:
parent
395985c44b
commit
998e6aeca2
1 changed files with 0 additions and 36 deletions
|
|
@ -1,36 +0,0 @@
|
||||||
/*
|
|
||||||
this bot will send an image of a cat to a channel.
|
|
||||||
may be slow depending on your internet connection.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var Discord = require("../");
|
|
||||||
|
|
||||||
// Get the email and password
|
|
||||||
var AuthDetails = require("./auth.json");
|
|
||||||
|
|
||||||
var bot = new Discord.Client();
|
|
||||||
|
|
||||||
bot.on("ready", function () {
|
|
||||||
console.log("Ready to begin! Serving in " + bot.channels.length + " channels");
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on("disconnected", function () {
|
|
||||||
|
|
||||||
console.log("Disconnected!");
|
|
||||||
process.exit(1); //exit node.js with an error
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on("message", function (msg) {
|
|
||||||
if (msg.content === "$cat") {
|
|
||||||
|
|
||||||
//send a message to the channel the ping message was sent in.
|
|
||||||
bot.sendMessage(msg.channel, "pong!");
|
|
||||||
|
|
||||||
//alert the console
|
|
||||||
console.log("pong-ed " + msg.sender.username);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.login(AuthDetails.email, AuthDetails.password);
|
|
||||||
Loading…
Reference in a new issue