mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 17:30:07 +00:00
feat(types/interaction): add "resolved" field to DiscordInteractionCommand (#603)
* fix(types): DiscordMember not extending DiscordBaseMember * add(types): DiscordInteractionDataResolved * add(types): resolved field to DiscordInteractionData * fix(types): DiscordInteractionData options is optional * Apply suggestions from code review Co-authored-by: ayntee <ayyantee@gmail.com> Co-authored-by: ayntee <ayyantee@gmail.com>
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { DiscordMember } from "./mod.ts";
|
||||
import {
|
||||
DiscordChannel,
|
||||
DiscordMember,
|
||||
DiscordRole,
|
||||
DiscordUser,
|
||||
} from "./mod.ts";
|
||||
|
||||
export interface DiscordInteractionCommand {
|
||||
/** id of the interaction */
|
||||
@@ -31,8 +36,24 @@ export interface DiscordInteractionData {
|
||||
id: string;
|
||||
/** the name of the invoked command */
|
||||
name: string;
|
||||
/** converted users + roles + channels */
|
||||
resolved?: DiscordApplicationCommandInteractionDataResolved;
|
||||
/** the params + values from the user */
|
||||
options: DiscordInteractionDataOption[];
|
||||
options?: DiscordInteractionDataOption[];
|
||||
}
|
||||
|
||||
export interface DiscordApplicationCommandInteractionDataResolved {
|
||||
/** the IDs and User objects */
|
||||
users?: Record<string, DiscordUser>;
|
||||
/** the IDs and partial Member objects */
|
||||
members?: Record<string, Omit<DiscordMember, "user" | "deaf" | "mute">>;
|
||||
/** the IDs and Role objects */
|
||||
roles?: Record<string, DiscordRole>;
|
||||
/** the IDs and partial Channel objects */
|
||||
channels?: Record<
|
||||
string,
|
||||
Pick<DiscordChannel, "id" | "name" | "type" | "permission_overwrites">
|
||||
>;
|
||||
}
|
||||
|
||||
export interface DiscordInteractionDataOption {
|
||||
|
||||
@@ -83,7 +83,7 @@ export interface DiscordBaseMember {
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure */
|
||||
export interface DiscordMember {
|
||||
export interface DiscordMember extends DiscordBaseMember {
|
||||
/** the user this guild member represents */
|
||||
user?: DiscordUser;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user