File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,15 +98,16 @@ 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 &&
107107 Boolean ( ch . lastMessageId ) ,
108108 )
109109 . values ( ) ;
110+ return [ interaction . channel as TextChannel , ...channels ] ;
110111} ;
111112
112113const checkPermission = async ( {
@@ -465,7 +466,7 @@ export const repelInteraction: CommandDataWithHandler = {
465466 RepelCommandOptions . DELETE_COUNT ,
466467 false ,
467468 ) ?? REPEL_DEFAULT_DELETE_COUNT ;
468- const channels = getTextChannels ( interaction . guild ) ;
469+ const channels = getTextChannels ( interaction ) ;
469470 const deleted = await handleDeleteMessages ( {
470471 channels,
471472 count,
You can’t perform that action at this time.
0 commit comments