Fixed suppress embeds crash

This commit is contained in:
2022-07-15 15:56:15 +07:00
parent c6b306a60e
commit c7cedf5624
2 changed files with 16 additions and 5 deletions
+10 -1
View File
@@ -10,7 +10,9 @@ import {
User,
SelectMenuInteraction,
InteractionType,
BaseInteraction
BaseInteraction,
GuildBasedChannel,
ChannelType
} from 'discord.js';
export default class DiscordModule {
@@ -87,6 +89,13 @@ export class HybridInteractionMessage {
return this.data.channel;
}
public getGuildChannel(): GuildBasedChannel | null {
if (this.data.channel && this.data.channel.type !== ChannelType.DM) {
return this.getChannel() as GuildBasedChannel;
}
return null;
}
public getGuild(): Guild | null {
return this.data.guild;
}