Skip to content

Commit

Permalink
Fix bug fix when guild is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
SiebeBaree committed Dec 6, 2022
1 parent 7640289 commit 23577c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/airdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const keys = Object.keys(rewards);

export const processAirdrop = async (guildData) => {
const guild = await bot.guilds.fetch(guildData.id);
if (!guild) return await resetAirdrop(guildData.id);
const channel = await guild.channels.fetch(guildData.airdropChannel);

if (!guild.members.me.permissions.has(PermissionsBitField.Flags.SendMessages) || !guild.members.me.permissionsIn(channel).has(PermissionsBitField.Flags.SendMessages)) {
Expand Down

0 comments on commit 23577c1

Please sign in to comment.