Skip to content

Commit

Permalink
fix: uncached guild owner
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobiah committed Apr 30, 2020
1 parent b3b0dc2 commit 25da280
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/eventHandlers/JoinNotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class JoinNotify extends Handler {

const tokens = [
`${guild.name} (${guild.id})`,
`**Owner:** ${guild.owner.user.username}#${guild.owner.user.discriminator} (${guild.ownerID})`,
guild.owner ? `**Owner:** ${guild.owner.user.username}#${guild.owner.user.discriminator} (${guild.ownerID})` : '',
`**Members:** ${guild.memberCount}`,
`**Bots:** ${bots.size}`,
`**Percent:** ${((bots.size / (guild.memberCount)) * 100).toFixed(2)}%`,
Expand All @@ -36,7 +36,7 @@ class JoinNotify extends Handler {
embeds: [{
color: 0x00d62e,
title: 'Joined Server',
description: tokens.join('\n'),
description: tokens.filter(a => a).join('\n'),
thumbnail: {
url: guild.iconURL(),
},
Expand Down
4 changes: 2 additions & 2 deletions src/eventHandlers/LeaveNotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LeaveNotify extends Handler {
const bots = guild.members.filter(member => member.user.bot);
const tokens = [
`${guild.name} (${guild.id})`,
`**Owner:** ${guild.owner.user.username}#${guild.owner.user.discriminator} (${guild.ownerID})`,
guild.owner ? `**Owner:** ${guild.owner.user.username}#${guild.owner.user.discriminator} (${guild.ownerID})` : '',
`**Members:** ${guild.memberCount}`,
`**Bots:** ${bots.size}`,
`**Percent:** ${((bots.size / (guild.memberCount)) * 100).toFixed(2)}%`,
Expand All @@ -35,7 +35,7 @@ class LeaveNotify extends Handler {
embeds: [{
color: 0x660000,
title: 'Left Server',
description: tokens.join('\n'),
description: tokens.filter(a => a).join('\n'),
thumbnail: {
url: guild.iconURL(),
},
Expand Down

0 comments on commit 25da280

Please sign in to comment.