Skip to content

Commit 51a18a1

Browse files
authored
fix(Help): 🐛 Hide owner-only commands from the Help autocomplete (#186)
1 parent d99d54c commit 51a18a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/events/interaction-create.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ module.exports = class InteractionCreateEvent extends SebediusEvent {
9494
async respondAutocomplete(interaction) {
9595
if (interaction.commandName === 'help') {
9696
const focusedValue = interaction.options.getFocused();
97-
const choices = this.bot.commands.map(c => c.name);
97+
const choices = this.bot.commands.filter(c => !c.ownerOnly).map(c => c.name);
9898
const filtered = choices.filter(c => c.includes(focusedValue));
9999
await interaction.respond(filtered.map(c => ({ name: c, value: c })));
100100
}
@@ -110,11 +110,11 @@ module.exports = class InteractionCreateEvent extends SebediusEvent {
110110
logInteraction(interaction) {
111111
let logMsg = `${interaction.commandName}${interaction.user.tag} (${interaction.user.id})`;
112112
if (interaction.inGuild()) {
113-
logMsg += ` # ${interaction.channel.name} (${interaction.channelId})`
114-
+ ` @ ${interaction.guild.name} (${interaction.guild.id})`;
113+
logMsg += ` #${interaction.channel.name} (${interaction.channelId})`
114+
+ ` ${interaction.guild.name} (${interaction.guild.id})`;
115115
}
116116
else {
117-
logMsg += '@ DM';
117+
logMsg += ' DM';
118118
}
119119
Logger.command(logMsg);
120120
return logMsg;

0 commit comments

Comments
 (0)