Skip to content

Instantly share code, notes, and snippets.

@TheNoobWar
Created December 4, 2019 02:16
Show Gist options
  • Save TheNoobWar/16b638d31f7d313a2ade8fc7dcf5ca4e to your computer and use it in GitHub Desktop.
Save TheNoobWar/16b638d31f7d313a2ade8fc7dcf5ca4e to your computer and use it in GitHub Desktop.
Discord.js send a message in every channel of a guild ID
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Ready!');
client.on("message", function(message) {
var server = client.guilds.get('Server ID here');
for (var i = 0; i < server.channels.array().length; i++) {
message.channel.send('Message you want sent here')
}
});
console.log('Done!');
});
client.login('Token ID here');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment