File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -98,15 +98,17 @@ const getTargetFromInteraction = async (
9898 return target ;
9999} ;
100100
101- const getTextChannels = ( guild : Guild ) => {
102- return guild . channels . cache
101+ const getTextChannels = ( interaction : ChatInputCommandInteraction ) => {
102+ const channels = interaction . guild . channels . cache
103103 . filter (
104104 ( ch ) : ch is TextChannel =>
105105 ! IGNORED_CHANNEL_CATEGORIES . includes ( ch . parentId ) &&
106106 ch . type === ChannelType . GuildText &&
107+ interaction . channelId !== ch . id &&
107108 Boolean ( ch . lastMessageId ) ,
108109 )
109110 . values ( ) ;
111+ return [ interaction . channel as TextChannel , ...channels ] ;
110112} ;
111113
112114const checkPermission = async ( {
@@ -465,7 +467,7 @@ export const repelInteraction: CommandDataWithHandler = {
465467 RepelCommandOptions . DELETE_COUNT ,
466468 false ,
467469 ) ?? REPEL_DEFAULT_DELETE_COUNT ;
468- const channels = getTextChannels ( interaction . guild ) ;
470+ const channels = getTextChannels ( interaction ) ;
469471 const deleted = await handleDeleteMessages ( {
470472 channels,
471473 count,
You can’t perform that action at this time.
0 commit comments