Skip to content

Commit

Permalink
feat(APIMessage): add interaction (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
  • Loading branch information
3 people committed Mar 15, 2021
1 parent 7343fab commit 0f29b32
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deno/v8/payloads/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
}

/**
Expand Down
22 changes: 22 additions & 0 deletions deno/v8/payloads/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
5 changes: 5 additions & 0 deletions v8/payloads/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
}

/**
Expand Down
22 changes: 22 additions & 0 deletions v8/payloads/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 0f29b32

Please sign in to comment.