aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord-akairo/BushCommandUtil.ts
blob: 7a06b357561f32a9e9e8467bc159c7a84bbae2c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { type BushCommand, type BushCommandHandler, type BushMessage, type BushSlashMessage } from '#lib';
import { CommandUtil, type ParsedComponentData } from 'discord-akairo';
import { type Collection, type Snowflake } from 'discord.js';

export interface BushParsedComponentData extends ParsedComponentData {
	command?: BushCommand;
}

export class BushCommandUtil<BushMessageType extends BushMessage | BushSlashMessage> extends CommandUtil<BushMessageType> {
	public declare parsed: BushParsedComponentData | null;
	public declare handler: BushCommandHandler;
	public declare message: BushMessageType;
	public declare messages: Collection<Snowflake, BushMessage> | null;

	public constructor(handler: BushCommandHandler, message: BushMessageType) {
		super(handler, message);
	}
}

export interface BushCommandUtil<BushMessageType extends BushMessage | BushSlashMessage> extends CommandUtil<BushMessageType> {
	isSlashMessage(message: BushMessage | BushSlashMessage): message is BushSlashMessage;
}