how to send message at 1pm discord bot code example
Example 1: how to send a message to a discord server using a bot
const channel = client.channels.cache.get(channel => channel.name === 'the channel name')
channel.send(message)
Example 2: how to have your discord bot send two message
const Discord = require('discord.js');
const Client = new Discord.Client();
const { token, prefix } = require('./config.json');
Client.on('ready',() =>{
console.log('Ready!');
})
Client.on('message', message=>{
let args = message.content.substring(prefix.length).split(" ");
switch(args[0]){
case 'example1':
const example1 = new Discord.MessageEmbed()
.setColor('#FF8D27')
.setAuthor('Test author')
.setDescription('Example text 1')
message.channel.send(example1)
const example2 = new Discord.MessageEmbed()
.setColor('#FF8D27')
.setAuthor('Test Author')
.setDescription('Example text 2')
message.channel.send(example2)
break;
}
})
Client.on(token)