File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 7
7
} from 'discord.js' ;
8
8
9
9
import { cache } from '../../core/cache' ;
10
- import { removeEmoji , removePunctuation , removeMarkdown } from '../../helpers/regex.helper' ;
10
+ import { removeEmoji , removeMarkdown , removePunctuation } from '../../helpers/regex.helper' ;
11
11
12
12
const ONE_MINUTE = 1 * 60 * 1000 ;
13
13
@@ -29,8 +29,18 @@ export const reactOnEndWithQuoi = async (message: Message) => {
29
29
if ( ! endWithQuoi ( message . content ) ) return ;
30
30
31
31
const channelIds = await cache . get ( 'quoiFeurChannels' , [ ] ) ;
32
- const channelHasGame = channelIds . find ( ( channelId ) => channelId === message . channelId ) ;
33
- if ( ! channelHasGame ) return ;
32
+
33
+ let messageParentId = null ;
34
+ if ( message . channel . type === ChannelType . PublicThread ) {
35
+ messageParentId = message . channel . parentId ;
36
+ }
37
+
38
+ const isMessageInQuoiFeurChannel = (
39
+ channelIds . includes ( message . channelId ) ||
40
+ ( messageParentId && channelIds . includes ( messageParentId ) )
41
+ ) ;
42
+
43
+ if ( ! isMessageInQuoiFeurChannel ) return ;
34
44
35
45
const probability = 1 / 6 ;
36
46
You can’t perform that action at this time.
0 commit comments