mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
✨ feat: Support thread channel
This commit is contained in:
@@ -10,7 +10,8 @@ import {
|
|||||||
TextBasedChannelMixin,
|
TextBasedChannelMixin,
|
||||||
ChannelType,
|
ChannelType,
|
||||||
BaseGuildVoiceChannel,
|
BaseGuildVoiceChannel,
|
||||||
InteractionType
|
InteractionType,
|
||||||
|
ThreadChannel
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
|
|
||||||
import Logger from '../libs/Logger';
|
import Logger from '../libs/Logger';
|
||||||
@@ -217,7 +218,13 @@ class Discord {
|
|||||||
|
|
||||||
// Handling guild commands
|
// Handling guild commands
|
||||||
this.client.on('messageCreate', async (message: Message) => {
|
this.client.on('messageCreate', async (message: Message) => {
|
||||||
if (!(message.channel instanceof BaseGuildTextChannel || message.channel instanceof BaseGuildVoiceChannel))
|
if (
|
||||||
|
!(
|
||||||
|
message.channel instanceof BaseGuildTextChannel ||
|
||||||
|
message.channel instanceof BaseGuildVoiceChannel ||
|
||||||
|
message.channel instanceof ThreadChannel
|
||||||
|
)
|
||||||
|
)
|
||||||
return;
|
return;
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
if (typeof message.guild?.id === 'undefined') return;
|
if (typeof message.guild?.id === 'undefined') return;
|
||||||
@@ -324,7 +331,13 @@ class Discord {
|
|||||||
// Handling mentions
|
// Handling mentions
|
||||||
this.client.on('messageCreate', async (message: Message) => {
|
this.client.on('messageCreate', async (message: Message) => {
|
||||||
// TODO: Handle DMs commands soon
|
// TODO: Handle DMs commands soon
|
||||||
if (!(message.channel instanceof BaseGuildTextChannel || message.channel instanceof BaseGuildVoiceChannel))
|
if (
|
||||||
|
!(
|
||||||
|
message.channel instanceof BaseGuildTextChannel ||
|
||||||
|
message.channel instanceof BaseGuildVoiceChannel ||
|
||||||
|
message.channel instanceof ThreadChannel
|
||||||
|
)
|
||||||
|
)
|
||||||
return;
|
return;
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user