Skip to content

Commit

Permalink
🐛 Handle invitations errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Jan 12, 2021
1 parent 26e4b66 commit eedf966
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/General/invitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Invitations extends Command {
guildOnly: true,
aliases: [],
memberPermissions: [],
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_CHANNELS" ],
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_GUILD" ],
nsfw: false,
ownerOnly: false,
cooldown: 3000
Expand All @@ -25,6 +25,7 @@ class Invitations extends Command {

// Gets the invites
const invites = await message.guild.fetchInvites().catch(() => {});
if (!invites) return message.error("misc:ERR_OCCURRED");

const memberInvites = invites.filter((i) => i.inviter && i.inviter.id === member.user.id);

Expand Down

0 comments on commit eedf966

Please sign in to comment.