feat(APIMessage): add interaction (#93)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
Advaith
2021-03-15 16:00:04 -07:00
committed by GitHub
parent 7343fabe82
commit 0f29b32e05
4 changed files with 54 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
import type { Permissions, Snowflake } from '../../common/mod.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
@@ -307,6 +308,10 @@ export interface APIMessage {
* See https://discord.com/developers/docs/resources/channel#message-object
*/
referenced_message?: APIMessage | null;
/**
* Sent if the message is a response to an Interaction
*/
interaction?: APIMessageInteraction;
}
/**

View File

@@ -245,6 +245,28 @@ export type APIInteractionApplicationCommandCallbackData = Omit<
'username' | 'avatar_url'
> & { flags?: MessageFlags };
/**
* https://discord.com/developers/docs/interactions/slash-commands#messageinteraction
*/
export interface APIMessageInteraction {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* The type of interaction
*/
type: InteractionType;
/**
* The name of the ApplicationCommand
*/
name: string;
/**
* The user who invoked the interaction
*/
user: APIUser;
}
/**
* @internal
*/

View File

@@ -5,6 +5,7 @@
import type { Permissions, Snowflake } from '../../common/index';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
import type { APIMessageInteraction } from './interactions';
import type { APIRole } from './permissions';
import type { APIUser } from './user';
@@ -307,6 +308,10 @@ export interface APIMessage {
* See https://discord.com/developers/docs/resources/channel#message-object
*/
referenced_message?: APIMessage | null;
/**
* Sent if the message is a response to an Interaction
*/
interaction?: APIMessageInteraction;
}
/**

View File

@@ -245,6 +245,28 @@ export type APIInteractionApplicationCommandCallbackData = Omit<
'username' | 'avatar_url'
> & { flags?: MessageFlags };
/**
* https://discord.com/developers/docs/interactions/slash-commands#messageinteraction
*/
export interface APIMessageInteraction {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* The type of interaction
*/
type: InteractionType;
/**
* The name of the ApplicationCommand
*/
name: string;
/**
* The user who invoked the interaction
*/
user: APIUser;
}
/**
* @internal
*/