Add check for login message

Check if enableLoginMessage is set to true before attempting to send a
message.
This commit is contained in:
SileNce5k 2021-03-11 03:16:07 +01:00
parent 0b5156721d
commit eefb3cd7f6
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -6,6 +6,7 @@ const {
token,
loginMessage,
loginChannel,
enableLoginMessage,
owners
} = require('./config.json');
@ -17,6 +18,7 @@ reloadCommands(client)
client.once('ready', () => {
console.log('Ready!');
client.user.setActivity(prefix, { type: 'LISTENING' });
if (enableLoginMessage === true)
try{
client.channels.cache.get(loginChannel).send(loginMessage)
}catch(err){