Skip to content

Commit cde3518

Browse files
authored
πŸ› fix: include the current channel in the list of channels to delete … (#21)
* πŸ› fix: include the current channel in the list of channels to delete messages from * πŸ”¨ refactor: rename variable in getTextChannels function * πŸ”¨ refactor: replace .map() with .values()
1 parent 137b48e commit cde3518

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

β€Žsrc/commands/moderation/repel.tsβ€Ž

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ const getTextChannels = (interaction: ChatInputCommandInteraction) => {
130130
console.error('Interaction is not in a guild');
131131
return [];
132132
}
133-
const channels = getPublicChannels(interaction.guild).map((c) => c);
134-
return channels;
133+
const channels = getPublicChannels(interaction.guild).values();
134+
return [
135+
interaction.channel as TextChannel,
136+
...channels.filter((channel) => channel.id !== interaction.channelId),
137+
];
135138
};
136139

137140
const handleDeleteMessages = async ({

0 commit comments

Comments
Β (0)