Flash Playz
Flash Playz

Reputation: 3

send message to specific channel upon ready/launch

im trying to find a way to send a message to a channel upon launch of the discord bot. I've tried using

client.on('message', (message) => {
client.on('ready', () => {
  channel = client.channels.cache.get('744630121213722696');
  channel.send('bot is up and running!');

})});

but no success, I get no error messages just no response from the bot

Upvotes: 0

Views: 110

Answers (1)

DylanCodes
DylanCodes

Reputation: 13

You can't have 2 handlers in one. Take away the client.on('message', (message) => {}

So new code would be:

client.on('ready', () => {
  channel = client.channels.cache.get('744630121213722696');
  channel.send('bot is up and running!');

});

Upvotes: 1

Related Questions