Skip to content

Commit

Permalink
fix(giveaway): giveaway host member check
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowplay1 committed Dec 31, 2023
1 parent 121d8ff commit 901a287
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Giveaways.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,17 +741,18 @@ export class Giveaways<
isEnded: false
}

const hostMember = await this.client.users.fetch(hostMemberID).catch(console.error) as User;
const hostMember = await this.client.users.fetch(hostMemberID).catch(console.error) as User

if (!hostMember) {
throw new GiveawaysError(
errorMessages.USER_NOT_FOUND(hostMemberID),
GiveawaysErrorCodes.USER_NOT_FOUND
);
throw new GiveawaysError(
errorMessages.USER_NOT_FOUND(hostMemberID),
GiveawaysErrorCodes.USER_NOT_FOUND
)
}

const definedEmbedStrings = defineEmbedStrings ? defineEmbedStrings<true>(
giveawayTemplate as any,
hostMember
giveawayTemplate as any,
hostMember
) : {}

const startEmbedStrings = definedEmbedStrings?.start || {}
Expand Down

0 comments on commit 901a287

Please sign in to comment.