mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-14 03:09:59 +00:00
Fixed discord.js v14 breaking changes
This commit is contained in:
@@ -8,7 +8,9 @@ import {
|
||||
TextBasedChannel,
|
||||
MessageComponentInteraction,
|
||||
User,
|
||||
SelectMenuInteraction
|
||||
SelectMenuInteraction,
|
||||
InteractionType,
|
||||
BaseInteraction
|
||||
} from 'discord.js';
|
||||
|
||||
export default class DiscordModule {
|
||||
@@ -56,17 +58,17 @@ export default class DiscordModule {
|
||||
}
|
||||
|
||||
export class HybridInteractionMessage {
|
||||
public data: Interaction | Message;
|
||||
constructor(data: Interaction | Message) {
|
||||
public data: BaseInteraction | Message;
|
||||
constructor(data: BaseInteraction | Message) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public isInteraction(): boolean {
|
||||
return this.data instanceof Interaction;
|
||||
return this.data instanceof BaseInteraction;
|
||||
}
|
||||
|
||||
public isSlashCommand(): boolean {
|
||||
return this.data instanceof CommandInteraction && this.data.isCommand();
|
||||
public isApplicationCommand(): boolean {
|
||||
return this.data instanceof CommandInteraction && this.data.type === InteractionType.ApplicationCommand;
|
||||
}
|
||||
|
||||
public isButton(): boolean {
|
||||
@@ -130,7 +132,7 @@ export class HybridInteractionMessage {
|
||||
return this.data as Message;
|
||||
}
|
||||
|
||||
public getRaw(): Interaction | Message {
|
||||
public getRaw(): BaseInteraction | Message {
|
||||
return this.data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user