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:
parent
86b3e57b4a
commit
ec456a9b32
1 changed files with 7 additions and 1 deletions
|
@ -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', () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue