Skip to content

Commit

Permalink
Merge pull request #492 from aternosorg/id
Browse files Browse the repository at this point in the history
don't send second message if no bans were found
  • Loading branch information
JulianVennen authored May 30, 2022
2 parents 25e95a4 + 7c5a33e commit dfe25af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/commands/CommandSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ class CommandSource {
return this.#interaction.editReply(options);
}
else {
if (!this.#response) {
return this.#message.channel.send(options);
}
return this.#response.edit(options);
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/commands/utility/IDCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ class IDCommand extends Command {

const users = /** @type {Collection<Snowflake, GuildMember>} */ await this.source.getGuild().members.fetch({query});

let replied = false;
if (users.size !== 0) {
await this.editReply(this._generateResultEmbed(query, Array.from(users.values()))
.setFooter({text: 'I\'m still searching the ban, on big guilds this can take a while...'}));
.setFooter({text: 'I\'m still searching in the ban list, on guilds with a lot of bans this can take a while...'}));
replied = true;
}
const bans = await this._fetchAndFilterBans(user, discrim);
if (bans.size === 0) {
if (bans.size === 0 && !replied) {
return this.sendError('No users found');
}
else {
Expand Down

0 comments on commit dfe25af

Please sign in to comment.