Skip to content

Commit

Permalink
"added check for sending a message to the owner"
Browse files Browse the repository at this point in the history
  • Loading branch information
Josee9988 committed Jun 23, 2021
1 parent d2a1602 commit 056f2fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ client.on('guildCreate', (guild: Guild) => { // when the bot joins a server
guild.systemChannel.send("Thanks for inviting me to your awesome serverπŸ’–, use **`!dimg help`** for more information :D.")
.catch(() => console.log("Couldn't send welcome message."));

// When the bot is added to a new server, it will send a DM to the server owner.
client.users.cache.get(guild.ownerID).send(welcomeOwnerPrivatelyMessage.msg)
.catch((e: any) => console.error(('Couldn\'t send a welcome DM message to the owner, ERROR:' + e)));
if (client.users.cache.get(guild.ownerID)) // When the bot is added to a new server, it will send a DM to the server owner.
client.users.cache.get(guild.ownerID).send(welcomeOwnerPrivatelyMessage.msg)
.catch((e: any) => console.error(('Couldn\'t send a welcome DM message to the owner, ERROR:' + e)));
});

// event listener "guildDelete".
Expand Down

0 comments on commit 056f2fd

Please sign in to comment.