aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushCommandInteraction.ts
blob: b61ec9b98d7261e2d9e6a234287a9fd895bf2a6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type {
	BushApplicationCommand,
	BushGuild,
	BushGuildChannel,
	BushGuildEmoji,
	BushGuildMember,
	BushRole,
	BushUser
} from '#lib';
import type { APIInteractionGuildMember } from 'discord-api-types/v9';
import { CommandInteraction, type CacheType, type CacheTypeReducer, type Invite, type Snowflake } from 'discord.js';
import type { RawCommandInteractionData } from 'discord.js/typings/rawDataTypes';
import { BushTextBasedChannels, type BushClient } from '../discord-akairo/BushClient';

export type BushGuildResolvable = BushGuild | BushGuildChannel | BushGuildMember | BushGuildEmoji | Invite | BushRole | Snowflake;

export class BushCommandInteraction<Cached extends CacheType = CacheType> extends CommandInteraction<Cached> {
	public declare readonly client: BushClient;
	public declare readonly command: BushApplicationCommand | BushApplicationCommand<{ guild: BushGuildResolvable }> | null;
	public declare readonly channel: CacheTypeReducer<Cached, BushTextBasedChannels | null>;
	public declare readonly guild: CacheTypeReducer<Cached, BushGuild, null>;
	public declare member: CacheTypeReducer<Cached, BushGuildMember, APIInteractionGuildMember>;
	public declare user: BushUser;

	public constructor(client: BushClient, data: RawCommandInteractionData) {
		super(client, data);
	}
}