Add online message

When the bot comes online, it will send a specified message to a
specified channel. Both specified in config.json
This commit is contained in:
SileNce5k 2021-03-11 00:09:45 +01:00
parent 86b3e57b4a
commit ec456a9b32
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -4,6 +4,8 @@ const client = new Discord.Client({ disableEveryone: true });
const {
prefix,
token,
loginMessage,
loginChannel
} = require('./config.json');
client.commands = new Discord.Collection();
@ -14,7 +16,11 @@ reloadCommands(client)
client.once('ready', () => {
console.log('Ready!');
client.user.setActivity(prefix, { type: 'LISTENING' });
try{
client.channels.cache.get(loginChannel).send(loginMessage)
}catch(err){
console.log("Failed trying to send a message on login.\n")
}
});
client.once('reconnecting', () => {