mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
* Update examples * Forgot to save send-files
This commit is contained in:
committed by
abalabahaha
parent
b9506d01ab
commit
8d64435def
@@ -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);
|
||||
Reference in New Issue
Block a user