Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
  • Loading branch information
almeidx and Jiralite authored Jan 19, 2025
1 parent bd702d0 commit 338c962
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/discord.js/src/managers/GuildInviteManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@ class GuildInviteManager extends CachedManager {
if (!options) return this._fetchMany();
if (typeof options === 'string') {
const code = resolveInviteCode(options);
if (!code) throw new DiscordjsError(ErrorCodes.InviteResolveCode)();
if (!code) throw new DiscordjsError(ErrorCodes.InviteResolveCode);
return this._fetchSingle({ code, cache: true });
}
if (!options.code) {
if (options.channelId) {
const id = this.guild.channels.resolveId(options.channelId);
if (!id) throw new DiscordjsError(ErrorCodes.GuildChannelResolve)();
if (!id) throw new DiscordjsError(ErrorCodes.GuildChannelResolve);
return this._fetchChannelMany(id, options.cache);
}

if ('cache' in options) return this._fetchMany(options.cache);
throw new DiscordjsError(ErrorCodes.InviteResolveCode)();
throw new DiscordjsError(ErrorCodes.InviteResolveCode);
}
return this._fetchSingle({
...options,
Expand Down

0 comments on commit 338c962

Please sign in to comment.