Update Examples (closes #380) (#383)

* Update examples

* Forgot to save send-files
This commit is contained in:
Manuel Kraus
2016-05-29 03:55:39 +02:00
committed by abalabahaha
parent b9506d01ab
commit 8d64435def
9 changed files with 114 additions and 176 deletions

View File

@@ -13,21 +13,18 @@ bot.on("ready", () => {
bot.on("message", (msg) => {
if (msg.content === "photos") {
bot.sendFile( msg.channel, "./test/image.png", "photo.png", (err, msg) => {
if(err)
console.log("couldn't send image:", err);
});
}
if( msg.content === "file" ) {
bot.sendFile( msg.channel, new Buffer("Text in a file!"), "file.txt", (err, msg) => {
if(err)
console.log("couldn't send file:", err);
bot.sendFile(msg, "./test/image.png", "photo.png", (err, sentMessage) => {
if (err)
console.log("Couldn't send image: ", err);
});
}
})
else if (msg.content === "file") {
bot.sendFile(msg.channel, new Buffer("Text in a file!"), "file.txt", (err, sentMessage) => {
if (err)
console.log("Couldn't send file: ", err)
});
}
});
bot.login(AuthDetails.email, AuthDetails.password);
bot.loginWithToken(AuthDetails.token);