@discordeno/bot 19.0.0-next.5c42bdd → 19.0.0-next.5edfbb7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import type { ButtonStyles, MessageComponentTypes, SelectOption, TextStyles } from '@discordeno/types';
1
+ import type { ButtonStyles, ChannelTypes, MessageComponentTypes, SelectOption, TextStyles } from '@discordeno/types';
2
2
  import type { Bot } from '../index.js';
3
3
  import type { DiscordComponent } from '../typings.js';
4
4
  export declare function transformComponent(bot: Bot, payload: DiscordComponent): Component;
@@ -28,6 +28,8 @@ export interface Component {
28
28
  };
29
29
  /** optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url */
30
30
  url?: string;
31
+ /** List of channel types to include in a channel select menu options list */
32
+ channelTypes?: ChannelTypes[];
31
33
  /** The choices! Maximum of 25 items. */
32
34
  options?: SelectOption[];
33
35
  /** A custom placeholder text if nothing is selected. Maximum 150 characters. */
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/transformers/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACtG,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAoCjF;AAID,MAAM,WAAW,SAAS;IACxB,qBAAqB;IACrB,IAAI,EAAE,qBAAqB,CAAA;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iDAAiD;IACjD,KAAK,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACjC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wGAAwG;IACxG,KAAK,CAAC,EAAE;QACN,eAAe;QACf,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,iBAAiB;QACjB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,qCAAqC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;IACD,uHAAuH;IACvH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wCAAwC;IACxC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;CACzB"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/transformers/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACpH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAqCjF;AAID,MAAM,WAAW,SAAS;IACxB,qBAAqB;IACrB,IAAI,EAAE,qBAAqB,CAAA;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iDAAiD;IACjD,KAAK,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACjC,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wGAAwG;IACxG,KAAK,CAAC,EAAE;QACN,eAAe;QACf,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,iBAAiB;QACjB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,qCAAqC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;IACD,uHAAuH;IACvH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,6EAA6E;IAC7E,YAAY,CAAC,EAAE,YAAY,EAAE,CAAA;IAC7B,wCAAwC;IACxC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;CACzB"}
@@ -11,6 +11,7 @@ export function transformComponent(bot, payload) {
11
11
  animated: payload.emoji.animated
12
12
  } : undefined,
13
13
  url: payload.url,
14
+ channelTypes: payload.channel_types,
14
15
  options: payload.options?.map((option)=>({
15
16
  label: option.label,
16
17
  value: option.value,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transformers/component.ts"],"sourcesContent":["import type { ButtonStyles, MessageComponentTypes, SelectOption, TextStyles } from '@discordeno/types'\nimport type { Bot } from '../index.js'\nimport type { DiscordComponent } from '../typings.js'\n\nexport function transformComponent(bot: Bot, payload: DiscordComponent): Component {\n return {\n type: payload.type,\n customId: payload.custom_id,\n disabled: payload.disabled,\n style: payload.style,\n label: payload.label,\n emoji: payload.emoji\n ? {\n id: payload.emoji.id ? bot.transformers.snowflake(payload.emoji.id) : undefined,\n name: payload.emoji.name,\n animated: payload.emoji.animated,\n }\n : undefined,\n url: payload.url,\n options: payload.options?.map((option) => ({\n label: option.label,\n value: option.value,\n description: option.description,\n emoji: option.emoji\n ? {\n id: option.emoji.id ? bot.transformers.snowflake(option.emoji.id) : undefined,\n name: option.emoji.name,\n animated: option.emoji.animated,\n }\n : undefined,\n default: option.default,\n })),\n placeholder: payload.placeholder,\n minValues: payload.min_values,\n maxValues: payload.max_values,\n minLength: payload.min_length,\n maxLength: payload.max_length,\n value: payload.value,\n components: payload.components?.map((component) => bot.transformers.component(bot, component)),\n }\n}\n\n// THIS TRANSFORMER HAS A CIRCULAR REFERENCE TO CALL ITSELF FOR COMPONENTS SO AN AUTOMATED TYPE CAN NOT BE CREATED!\n\nexport interface Component {\n /** component type */\n type: MessageComponentTypes\n /** a developer-defined identifier for the component, max 100 characters */\n customId?: string\n /** whether this component is required to be filled, default true */\n required?: boolean\n /** whether the component is disabled, default false */\n disabled?: boolean\n /** For different styles/colors of the buttons */\n style?: ButtonStyles | TextStyles\n /** text that appears on the button (max 80 characters) */\n label?: string\n /** the dev-define value of the option, max 100 characters for select or 4000 for input. */\n value?: string\n /** Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis. */\n emoji?: {\n /** Emoji id */\n id?: bigint\n /** Emoji name */\n name?: string\n /** Whether this emoji is animated */\n animated?: boolean\n }\n /** optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url */\n url?: string\n /** The choices! Maximum of 25 items. */\n options?: SelectOption[]\n /** A custom placeholder text if nothing is selected. Maximum 150 characters. */\n placeholder?: string\n /** The minimum number of items that must be selected. Default 1. Between 1-25. */\n minValues?: number\n /** The maximum number of items that can be selected. Default 1. Between 1-25. */\n maxValues?: number\n /** The minimum input length for a text input. Between 0-4000. */\n minLength?: number\n /** The maximum input length for a text input. Between 1-4000. */\n maxLength?: number\n /** a list of child components */\n components?: Component[]\n}\n"],"names":["transformComponent","bot","payload","type","customId","custom_id","disabled","style","label","emoji","id","transformers","snowflake","undefined","name","animated","url","options","map","option","value","description","default","placeholder","minValues","min_values","maxValues","max_values","minLength","min_length","maxLength","max_length","components","component"],"mappings":"AAIA,OAAO,SAASA,mBAAmBC,GAAQ,EAAEC,OAAyB,EAAa;IACjF,OAAO;QACLC,MAAMD,QAAQC,IAAI;QAClBC,UAAUF,QAAQG,SAAS;QAC3BC,UAAUJ,QAAQI,QAAQ;QAC1BC,OAAOL,QAAQK,KAAK;QACpBC,OAAON,QAAQM,KAAK;QACpBC,OAAOP,QAAQO,KAAK,GAChB;YACEC,IAAIR,QAAQO,KAAK,CAACC,EAAE,GAAGT,IAAIU,YAAY,CAACC,SAAS,CAACV,QAAQO,KAAK,CAACC,EAAE,IAAIG,SAAS;YAC/EC,MAAMZ,QAAQO,KAAK,CAACK,IAAI;YACxBC,UAAUb,QAAQO,KAAK,CAACM,QAAQ;QAClC,IACAF,SAAS;QACbG,KAAKd,QAAQc,GAAG;QAChBC,SAASf,QAAQe,OAAO,EAAEC,IAAI,CAACC,SAAY,CAAA;gBACzCX,OAAOW,OAAOX,KAAK;gBACnBY,OAAOD,OAAOC,KAAK;gBACnBC,aAAaF,OAAOE,WAAW;gBAC/BZ,OAAOU,OAAOV,KAAK,GACf;oBACEC,IAAIS,OAAOV,KAAK,CAACC,EAAE,GAAGT,IAAIU,YAAY,CAACC,SAAS,CAACO,OAAOV,KAAK,CAACC,EAAE,IAAIG,SAAS;oBAC7EC,MAAMK,OAAOV,KAAK,CAACK,IAAI;oBACvBC,UAAUI,OAAOV,KAAK,CAACM,QAAQ;gBACjC,IACAF,SAAS;gBACbS,SAASH,OAAOG,OAAO;YACzB,CAAA;QACAC,aAAarB,QAAQqB,WAAW;QAChCC,WAAWtB,QAAQuB,UAAU;QAC7BC,WAAWxB,QAAQyB,UAAU;QAC7BC,WAAW1B,QAAQ2B,UAAU;QAC7BC,WAAW5B,QAAQ6B,UAAU;QAC7BX,OAAOlB,QAAQkB,KAAK;QACpBY,YAAY9B,QAAQ8B,UAAU,EAAEd,IAAI,CAACe,YAAchC,IAAIU,YAAY,CAACsB,SAAS,CAAChC,KAAKgC;IACrF;AACF,CAAC"}
1
+ {"version":3,"sources":["../../src/transformers/component.ts"],"sourcesContent":["import type { ButtonStyles, ChannelTypes, MessageComponentTypes, SelectOption, TextStyles } from '@discordeno/types'\nimport type { Bot } from '../index.js'\nimport type { DiscordComponent } from '../typings.js'\n\nexport function transformComponent(bot: Bot, payload: DiscordComponent): Component {\n return {\n type: payload.type,\n customId: payload.custom_id,\n disabled: payload.disabled,\n style: payload.style,\n label: payload.label,\n emoji: payload.emoji\n ? {\n id: payload.emoji.id ? bot.transformers.snowflake(payload.emoji.id) : undefined,\n name: payload.emoji.name,\n animated: payload.emoji.animated,\n }\n : undefined,\n url: payload.url,\n channelTypes: payload.channel_types,\n options: payload.options?.map((option) => ({\n label: option.label,\n value: option.value,\n description: option.description,\n emoji: option.emoji\n ? {\n id: option.emoji.id ? bot.transformers.snowflake(option.emoji.id) : undefined,\n name: option.emoji.name,\n animated: option.emoji.animated,\n }\n : undefined,\n default: option.default,\n })),\n placeholder: payload.placeholder,\n minValues: payload.min_values,\n maxValues: payload.max_values,\n minLength: payload.min_length,\n maxLength: payload.max_length,\n value: payload.value,\n components: payload.components?.map((component) => bot.transformers.component(bot, component)),\n }\n}\n\n// THIS TRANSFORMER HAS A CIRCULAR REFERENCE TO CALL ITSELF FOR COMPONENTS SO AN AUTOMATED TYPE CAN NOT BE CREATED!\n\nexport interface Component {\n /** component type */\n type: MessageComponentTypes\n /** a developer-defined identifier for the component, max 100 characters */\n customId?: string\n /** whether this component is required to be filled, default true */\n required?: boolean\n /** whether the component is disabled, default false */\n disabled?: boolean\n /** For different styles/colors of the buttons */\n style?: ButtonStyles | TextStyles\n /** text that appears on the button (max 80 characters) */\n label?: string\n /** the dev-define value of the option, max 100 characters for select or 4000 for input. */\n value?: string\n /** Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis. */\n emoji?: {\n /** Emoji id */\n id?: bigint\n /** Emoji name */\n name?: string\n /** Whether this emoji is animated */\n animated?: boolean\n }\n /** optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url */\n url?: string\n /** List of channel types to include in a channel select menu options list */\n channelTypes?: ChannelTypes[]\n /** The choices! Maximum of 25 items. */\n options?: SelectOption[]\n /** A custom placeholder text if nothing is selected. Maximum 150 characters. */\n placeholder?: string\n /** The minimum number of items that must be selected. Default 1. Between 1-25. */\n minValues?: number\n /** The maximum number of items that can be selected. Default 1. Between 1-25. */\n maxValues?: number\n /** The minimum input length for a text input. Between 0-4000. */\n minLength?: number\n /** The maximum input length for a text input. Between 1-4000. */\n maxLength?: number\n /** a list of child components */\n components?: Component[]\n}\n"],"names":["transformComponent","bot","payload","type","customId","custom_id","disabled","style","label","emoji","id","transformers","snowflake","undefined","name","animated","url","channelTypes","channel_types","options","map","option","value","description","default","placeholder","minValues","min_values","maxValues","max_values","minLength","min_length","maxLength","max_length","components","component"],"mappings":"AAIA,OAAO,SAASA,mBAAmBC,GAAQ,EAAEC,OAAyB,EAAa;IACjF,OAAO;QACLC,MAAMD,QAAQC,IAAI;QAClBC,UAAUF,QAAQG,SAAS;QAC3BC,UAAUJ,QAAQI,QAAQ;QAC1BC,OAAOL,QAAQK,KAAK;QACpBC,OAAON,QAAQM,KAAK;QACpBC,OAAOP,QAAQO,KAAK,GAChB;YACEC,IAAIR,QAAQO,KAAK,CAACC,EAAE,GAAGT,IAAIU,YAAY,CAACC,SAAS,CAACV,QAAQO,KAAK,CAACC,EAAE,IAAIG,SAAS;YAC/EC,MAAMZ,QAAQO,KAAK,CAACK,IAAI;YACxBC,UAAUb,QAAQO,KAAK,CAACM,QAAQ;QAClC,IACAF,SAAS;QACbG,KAAKd,QAAQc,GAAG;QAChBC,cAAcf,QAAQgB,aAAa;QACnCC,SAASjB,QAAQiB,OAAO,EAAEC,IAAI,CAACC,SAAY,CAAA;gBACzCb,OAAOa,OAAOb,KAAK;gBACnBc,OAAOD,OAAOC,KAAK;gBACnBC,aAAaF,OAAOE,WAAW;gBAC/Bd,OAAOY,OAAOZ,KAAK,GACf;oBACEC,IAAIW,OAAOZ,KAAK,CAACC,EAAE,GAAGT,IAAIU,YAAY,CAACC,SAAS,CAACS,OAAOZ,KAAK,CAACC,EAAE,IAAIG,SAAS;oBAC7EC,MAAMO,OAAOZ,KAAK,CAACK,IAAI;oBACvBC,UAAUM,OAAOZ,KAAK,CAACM,QAAQ;gBACjC,IACAF,SAAS;gBACbW,SAASH,OAAOG,OAAO;YACzB,CAAA;QACAC,aAAavB,QAAQuB,WAAW;QAChCC,WAAWxB,QAAQyB,UAAU;QAC7BC,WAAW1B,QAAQ2B,UAAU;QAC7BC,WAAW5B,QAAQ6B,UAAU;QAC7BC,WAAW9B,QAAQ+B,UAAU;QAC7BX,OAAOpB,QAAQoB,KAAK;QACpBY,YAAYhC,QAAQgC,UAAU,EAAEd,IAAI,CAACe,YAAclC,IAAIU,YAAY,CAACwB,SAAS,CAAClC,KAAKkC;IACrF;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type ApplicationCommandOptionTypes, type ApplicationCommandTypes, type CamelizedDiscordMessage, type ChannelTypes, type DiscordInteraction, type DiscordInteractionDataOption, type InteractionResponse, type InteractionTypes, type MessageComponentTypes } from '@discordeno/types';
1
+ import { InteractionTypes, type ApplicationCommandOptionTypes, type ApplicationCommandTypes, type BigString, type CamelizedDiscordMessage, type ChannelTypes, type DiscordInteraction, type DiscordInteractionDataOption, type InteractionCallbackData, type MessageComponentTypes } from '@discordeno/types';
2
2
  import { Collection } from '@discordeno/utils';
3
3
  import type { Bot, Component } from '../index.js';
4
4
  import type { DiscordInteractionDataResolved } from '../typings.js';
@@ -10,7 +10,7 @@ import type { User } from './user.js';
10
10
  export interface Interaction extends BaseInteraction {
11
11
  /** The bot object */
12
12
  bot: Bot;
13
- /** Whether or not this interaction has been replied to. */
13
+ /** Whether or not this interaction has been responded to. */
14
14
  acknowledged: boolean;
15
15
  /** Id of the interaction */
16
16
  id: bigint;
@@ -54,9 +54,15 @@ export interface Interaction extends BaseInteraction {
54
54
  }
55
55
  export interface BaseInteraction {
56
56
  /** Sends a response to an interaction. */
57
- respond: (response: string | InteractionResponse, options: {
58
- private: boolean;
57
+ respond: (response: string | InteractionCallbackData, options?: {
58
+ isPrivate?: boolean;
59
59
  }) => Promise<CamelizedDiscordMessage | void>;
60
+ /** Edit the original response of an interaction. */
61
+ edit: (response: string | InteractionCallbackData) => Promise<CamelizedDiscordMessage>;
62
+ /** Defer the interaction. */
63
+ defer: (isPrivate?: boolean) => Promise<void>;
64
+ /** Delete the original interaction response or a followup message */
65
+ delete: (messageId?: BigString) => Promise<void>;
60
66
  }
61
67
  export declare function transformInteraction(bot: Bot, payload: DiscordInteraction): Interaction;
62
68
  export declare function transformInteractionDataOption(bot: Bot, option: DiscordInteractionDataOption): InteractionDataOption;
@@ -1 +1 @@
1
- {"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../src/transformers/interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,KAAK,EAAE,GAAG,EAAE,SAA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MAAM,EAAE,UAAU,CAAC,CAAA;CAC7C;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,6BAA6B,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;IACjC,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAA;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
@@ -1,25 +1,55 @@
1
- import { InteractionResponseTypes } from '@discordeno/types';
1
+ import { InteractionResponseTypes, InteractionTypes } from '@discordeno/types';
2
2
  import { Collection } from '@discordeno/utils';
3
3
  const baseInteraction = {
4
4
  async respond (response, options) {
5
- // If user provides a string, change it to response object
6
- if (typeof response === 'string') {
7
- response = {
8
- type: InteractionResponseTypes.DeferredChannelMessageWithSource,
9
- data: {
10
- content: response
11
- }
12
- };
13
- }
14
- // If user wants to send a ephemeral message
15
- if (options.private && response.data) response.data.flags = 64;
5
+ let type = InteractionResponseTypes.ChannelMessageWithSource;
6
+ // If user provides a string, change it to a response object
7
+ if (typeof response === 'string') response = {
8
+ content: response
9
+ };
10
+ else if (response.title) type = InteractionResponseTypes.Modal;
11
+ else if (this.type === InteractionTypes.ApplicationCommandAutocomplete) type = InteractionResponseTypes.ApplicationCommandAutocompleteResult;
12
+ // If user wants to send a private message
13
+ if (type === InteractionResponseTypes.ChannelMessageWithSource && options?.isPrivate) response.flags = 64;
14
+ // Since this has already been given a response, any further responses must be followups.
15
+ if (this.acknowledged) return await this.bot?.rest.sendFollowupMessage(this.token, response);
16
+ // Modals cannot be chained
17
+ if (this.type === InteractionTypes.ModalSubmit && type === InteractionResponseTypes.Modal) throw new Error('Cannot respond to a modal interaction with another modal.');
18
+ // Autocomplete response can only be used for autocomplete interactions
19
+ if (this.type === InteractionTypes.ApplicationCommandAutocomplete && type !== InteractionResponseTypes.ApplicationCommandAutocompleteResult) throw new Error('Cannot respond to an autocomplete interaction with a modal or message.');
16
20
  // If user has not already responded to this interaction we need to send an original response
17
- if (!this.acknowledged) {
18
- this.acknowledged = true;
19
- return await this.bot?.rest.sendInteractionResponse(this.id, this.token, response);
20
- }
21
- // Since this has already been given a response, any further responses must be folloups.
22
- return await this.bot?.rest.sendFollowupMessage(this.token, response.data);
21
+ this.acknowledged = true;
22
+ return await this.bot?.rest.sendInteractionResponse(this.id, this.token, {
23
+ type,
24
+ data: response
25
+ });
26
+ },
27
+ async edit (response) {
28
+ if (this.type === InteractionTypes.ApplicationCommandAutocomplete) throw new Error('Cannot edit an autocomplete interaction');
29
+ // If user provides a string, change it to a response object
30
+ if (typeof response === 'string') response = {
31
+ content: response
32
+ };
33
+ return await this.bot.rest.editOriginalInteractionResponse(this.token, response);
34
+ },
35
+ async defer (isPrivate) {
36
+ if (this.type === InteractionTypes.ApplicationCommandAutocomplete) throw new Error('Cannot defer an autocomplete interaction');
37
+ if (this.acknowledged) throw new Error('Cannot defer an already responded interaction');
38
+ // Determine the type of defer response
39
+ const type = this.type === InteractionTypes.MessageComponent ? InteractionResponseTypes.DeferredUpdateMessage : InteractionResponseTypes.DeferredChannelMessageWithSource;
40
+ // If user wants to send a private message
41
+ const data = {};
42
+ if (isPrivate) data.flags = 64;
43
+ this.acknowledged = true;
44
+ return await this.bot?.rest.sendInteractionResponse(this.id, this.token, {
45
+ type,
46
+ data
47
+ });
48
+ },
49
+ async delete (messageId) {
50
+ if (this.type === InteractionTypes.ApplicationCommandAutocomplete) throw new Error('Cannot delete an autocomplete interaction');
51
+ if (messageId) return await this.bot?.rest.deleteFollowupMessage(this.token, messageId);
52
+ else return await this.bot?.rest.deleteOriginalInteractionResponse(this.token);
23
53
  }
24
54
  };
25
55
  export function transformInteraction(bot, payload) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transformers/interaction.ts"],"sourcesContent":["import {\n InteractionResponseTypes,\n type ApplicationCommandOptionTypes,\n type ApplicationCommandTypes,\n type CamelizedDiscordMessage,\n type ChannelTypes,\n type DiscordInteraction,\n type DiscordInteractionDataOption,\n type InteractionResponse,\n type InteractionTypes,\n type MessageComponentTypes,\n} from '@discordeno/types'\nimport { Collection } from '@discordeno/utils'\nimport type { Bot, Component } from '../index.js'\nimport type { DiscordInteractionDataResolved } from '../typings.js'\nimport type { Attachment } from './attachment.js'\nimport type { Member } from './member.js'\nimport type { Message } from './message.js'\nimport type { Role } from './role.js'\nimport type { User } from './user.js'\n\nexport interface Interaction extends BaseInteraction {\n /** The bot object */\n bot: Bot\n /** Whether or not this interaction has been replied to. */\n acknowledged: boolean\n /** Id of the interaction */\n id: bigint\n /** Id of the application this interaction is for */\n applicationId: bigint\n /** The type of interaction */\n type: InteractionTypes\n /** The guild it was sent from */\n guildId?: bigint\n /** The channel it was sent from */\n channelId?: bigint\n /** Guild member data for the invoking user, including permissions */\n member?: Member\n /** User object for the invoking user, if invoked in a DM */\n user: User\n /** A continuation token for responding to the interaction */\n token: string\n /** Read-only property, always `1` */\n version: 1\n /** For the message the button was attached to */\n message?: Message\n /** the command data payload */\n data?: {\n type?: ApplicationCommandTypes\n componentType?: MessageComponentTypes\n customId?: string\n components?: Component[]\n values?: string[]\n name: string\n resolved?: InteractionDataResolved\n options?: InteractionDataOption[]\n id?: bigint\n targetId?: bigint\n // guildId?: bigint\n }\n /** The selected language of the invoking user */\n locale?: string\n /** The guild's preferred locale, if invoked in a guild */\n guildLocale?: string\n /** The computed permissions for a bot or app in the context of a specific interaction (including channel overwrites) */\n appPermissions: bigint\n}\n\nexport interface BaseInteraction {\n /** Sends a response to an interaction. */\n respond: (response: string | InteractionResponse, options: { private: boolean }) => Promise<CamelizedDiscordMessage | void>\n}\n\nconst baseInteraction: Partial<Interaction> & BaseInteraction = {\n async respond(response, options) {\n // If user provides a string, change it to response object\n if (typeof response === 'string') {\n response = {\n type: InteractionResponseTypes.DeferredChannelMessageWithSource,\n data: {\n content: response,\n },\n }\n }\n\n // If user wants to send a ephemeral message\n if (options.private && response.data) response.data.flags = 64\n // If user has not already responded to this interaction we need to send an original response\n if (!this.acknowledged) {\n this.acknowledged = true;\n return await this.bot?.rest.sendInteractionResponse(this.id!, this.token!, response)\n }\n // Since this has already been given a response, any further responses must be folloups.\n return await this.bot?.rest.sendFollowupMessage(this.token!, response.data!)\n },\n}\n\nexport function transformInteraction(bot: Bot, payload: DiscordInteraction): Interaction {\n const guildId = payload.guild_id ? bot.transformers.snowflake(payload.guild_id) : undefined\n const user = bot.transformers.user(bot, payload.member?.user ?? payload.user!)\n\n const interaction: Interaction = Object.create(baseInteraction)\n const props = bot.transformers.desiredProperties.interaction\n interaction.bot = bot\n interaction.acknowledged = false\n\n if (payload.id && props.id) interaction.id = bot.transformers.snowflake(payload.id)\n if (payload.application_id && props.applicationId) interaction.applicationId = bot.transformers.snowflake(payload.application_id)\n if (payload.type && props.type) interaction.type = payload.type\n if (payload.token && props.token) interaction.token = payload.token\n if (payload.version && props.version) interaction.version = payload.version\n if (payload.locale && props.locale) interaction.locale = payload.locale\n if (payload.guild_locale && props.guildLocale) interaction.guildLocale = payload.guild_locale\n if (guildId && props.guildId) interaction.guildId = guildId\n if (props.user) interaction.user = user\n if (payload.app_permissions && props.appPermissions) interaction.appPermissions = bot.transformers.snowflake(payload.app_permissions)\n if (payload.message && props.message) interaction.message = bot.transformers.message(bot, payload.message)\n if (payload.channel_id && props.channelId) interaction.channelId = bot.transformers.snowflake(payload.channel_id)\n if (payload.member && guildId && props.member) interaction.member = bot.transformers.member(bot, payload.member, guildId, user.id)\n if (payload.data && props.data) {\n interaction.data = {\n type: payload.data.type,\n componentType: payload.data.component_type,\n customId: payload.data.custom_id,\n components: payload.data.components?.map((component) => bot.transformers.component(bot, component)),\n values: payload.data.values,\n id: payload.data.id ? bot.transformers.snowflake(payload.data.id) : undefined,\n name: payload.data.name,\n resolved: payload.data.resolved ? transformInteractionDataResolved(bot, payload.data.resolved, guildId) : undefined,\n options: payload.data.options?.map((opt) => bot.transformers.interactionDataOptions(bot, opt)),\n targetId: payload.data.target_id ? bot.transformers.snowflake(payload.data.target_id) : undefined,\n // guildId: payload.data.guild_id ? bot.transformers.snowflake(payload.data.guild_id) : undefined,\n }\n }\n\n return bot.transformers.customizers.interaction(bot, payload, interaction)\n}\n\nexport function transformInteractionDataOption(bot: Bot, option: DiscordInteractionDataOption): InteractionDataOption {\n const opt = {\n name: option.name,\n type: option.type,\n value: option.value,\n options: option.options,\n focused: option.focused,\n }\n\n return opt\n}\n\nexport function transformInteractionDataResolved(bot: Bot, resolved: DiscordInteractionDataResolved, guildId?: bigint): InteractionDataResolved {\n const transformed: InteractionDataResolved = {}\n\n if (resolved.messages) {\n transformed.messages = new Collection(\n Object.entries(resolved.messages).map(([id, value]) => {\n const message: Message = bot.transformers.message(bot, value)\n return [message.id, message]\n }),\n )\n }\n\n if (resolved.users) {\n transformed.users = new Collection(\n Object.entries(resolved.users).map(([id, value]) => {\n const user = bot.transformers.user(bot, value)\n return [user.id, user]\n }),\n )\n }\n\n if (guildId && resolved.members) {\n transformed.members = new Collection(\n Object.entries(resolved.members).map(([id, value]) => {\n const member: Member = bot.transformers.member(bot, value, guildId, bot.transformers.snowflake(id))\n return [member.id, member]\n }),\n )\n }\n\n if (guildId && resolved.roles) {\n transformed.roles = new Collection(\n Object.entries(resolved.roles).map(([id, value]) => {\n const role = bot.transformers.role(bot, { role: value, guildId })\n return [role.id, role]\n }),\n )\n }\n\n if (resolved.channels) {\n transformed.channels = new Collection(\n Object.entries(resolved.channels).map(([key, value]) => {\n const id = bot.transformers.snowflake(key)\n const channel = value as {\n id: string\n name: string\n type: ChannelTypes\n permissions: string\n }\n return [\n id,\n {\n id,\n name: channel.name,\n type: channel.type,\n permissions: bot.transformers.snowflake(channel.permissions),\n },\n ]\n }),\n )\n }\n\n if (resolved.attachments) {\n transformed.attachments = new Collection(\n Object.entries(resolved.attachments).map(([key, value]) => {\n const id = bot.transformers.snowflake(key)\n return [id, bot.transformers.attachment(bot, value)]\n }),\n )\n }\n\n return transformed\n}\n\nexport interface InteractionDataResolved {\n messages?: Collection<bigint, Message>\n users?: Collection<bigint, User>\n members?: Collection<bigint, Member>\n roles?: Collection<bigint, Role>\n channels?: Collection<bigint, { id: bigint; name: string; type: ChannelTypes; permissions: bigint }>\n attachments?: Collection<bigint, Attachment>\n}\n\nexport interface InteractionDataOption {\n name: string\n type: ApplicationCommandOptionTypes\n value?: string | number | boolean\n options?: InteractionDataOption[]\n focused?: boolean\n}\n"],"names":["InteractionResponseTypes","Collection","baseInteraction","respond","response","options","type","DeferredChannelMessageWithSource","data","content","private","flags","acknowledged","bot","rest","sendInteractionResponse","id","token","sendFollowupMessage","transformInteraction","payload","guildId","guild_id","transformers","snowflake","undefined","user","member","interaction","Object","create","props","desiredProperties","application_id","applicationId","version","locale","guild_locale","guildLocale","app_permissions","appPermissions","message","channel_id","channelId","componentType","component_type","customId","custom_id","components","map","component","values","name","resolved","transformInteractionDataResolved","opt","interactionDataOptions","targetId","target_id","customizers","transformInteractionDataOption","option","value","focused","transformed","messages","entries","users","members","roles","role","channels","key","channel","permissions","attachments","attachment"],"mappings":"AAAA,SACEA,wBAAwB,QAUnB,oBAAmB;AAC1B,SAASC,UAAU,QAAQ,oBAAmB;AA6D9C,MAAMC,kBAA0D;IAC9D,MAAMC,SAAQC,QAAQ,EAAEC,OAAO,EAAE;QAC/B,0DAA0D;QAC1D,IAAI,OAAOD,aAAa,UAAU;YAChCA,WAAW;gBACTE,MAAMN,yBAAyBO,gCAAgC;gBAC/DC,MAAM;oBACJC,SAASL;gBACX;YACF;QACF,CAAC;QAED,4CAA4C;QAC5C,IAAIC,QAAQK,OAAO,IAAIN,SAASI,IAAI,EAAEJ,SAASI,IAAI,CAACG,KAAK,GAAG;QAC5D,6FAA6F;QAC7F,IAAI,CAAC,IAAI,CAACC,YAAY,EAAE;YACtB,IAAI,CAACA,YAAY,GAAG,IAAI;YACxB,OAAO,MAAM,IAAI,CAACC,GAAG,EAAEC,KAAKC,uBAAuB,CAAC,IAAI,CAACC,EAAE,EAAG,IAAI,CAACC,KA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AAI;oBAClBoE,aAAa7D,IAAIU,YAAY,CAACC,SAAS,CAACiD,QAAQC,WAAW;gBAC7D;aACD;QACH;IAEJ,CAAC;IAED,IAAIrB,SAASsB,WAAW,EAAE;QACxBX,YAAYW,WAAW,GAAG,IAAI1E,WAC5B4B,OAAOqC,OAAO,CAACb,SAASsB,WAAW,EAAE1B,GAAG,CAAC,CAAC,CAACuB,KAAKV,MAAM,GAAK;YACzD,MAAM9C,KAAKH,IAAIU,YAAY,CAACC,SAAS,CAACgD;YACtC,OAAO;gBAACxD;gBAAIH,IAAIU,YAAY,CAACqD,UAAU,CAAC/D,KAAKiD;aAAO;QACtD;IAEJ,CAAC;IAED,OAAOE;AACT,CAAC"}
1
+ {"version":3,"sources":["../../src/transformers/interaction.ts"],"sourcesContent":["import {\n InteractionResponseTypes,\n InteractionTypes,\n type ApplicationCommandOptionTypes,\n type ApplicationCommandTypes,\n type BigString,\n type CamelizedDiscordMessage,\n type ChannelTypes,\n type DiscordInteraction,\n type DiscordInteractionDataOption,\n type InteractionCallbackData,\n type MessageComponentTypes,\n} from '@discordeno/types'\nimport { Collection } from '@discordeno/utils'\nimport type { Bot, Component } from '../index.js'\nimport type { DiscordInteractionDataResolved } from '../typings.js'\nimport type { Attachment } from './attachment.js'\nimport type { Member } from './member.js'\nimport type { Message } from './message.js'\nimport type { Role } from './role.js'\nimport type { User } from './user.js'\n\nexport interface Interaction extends BaseInteraction {\n /** The bot object */\n bot: Bot\n /** Whether or not this interaction has been responded to. */\n acknowledged: boolean\n /** Id of the interaction */\n id: bigint\n /** Id of the application this interaction is for */\n applicationId: bigint\n /** The type of interaction */\n type: InteractionTypes\n /** The guild it was sent from */\n guildId?: bigint\n /** The channel it was sent from */\n channelId?: bigint\n /** Guild member data for the invoking user, including permissions */\n member?: Member\n /** User object for the invoking user, if invoked in a DM */\n user: User\n /** A continuation token for responding to the interaction */\n token: string\n /** Read-only property, always `1` */\n version: 1\n /** For the message the button was attached to */\n message?: Message\n /** the command data payload */\n data?: {\n type?: ApplicationCommandTypes\n componentType?: MessageComponentTypes\n customId?: string\n components?: Component[]\n values?: string[]\n name: string\n resolved?: InteractionDataResolved\n options?: InteractionDataOption[]\n id?: bigint\n targetId?: bigint\n // guildId?: bigint\n }\n /** The selected language of the invoking user */\n locale?: string\n /** The guild's preferred locale, if invoked in a guild */\n guildLocale?: string\n /** The computed permissions for a bot or app in the context of a specific interaction (including channel overwrites) */\n appPermissions: bigint\n}\n\nexport interface BaseInteraction {\n /** Sends a response to an interaction. */\n respond: (response: string | InteractionCallbackData, options?: { isPrivate?: boolean }) => Promise<CamelizedDiscordMessage | void>\n /** Edit the original response of an interaction. */\n edit: (response: string | InteractionCallbackData) => Promise<CamelizedDiscordMessage>\n /** Defer the interaction. */\n defer: (isPrivate?: boolean) => Promise<void>\n /** Delete the original interaction response or a followup message */\n delete: (messageId?: BigString) => Promise<void>\n}\n\nconst baseInteraction: Partial<Interaction> & BaseInteraction = {\n async respond(response, options) {\n let type = InteractionResponseTypes.ChannelMessageWithSource\n\n // If user provides a string, change it to a response object\n if (typeof response === 'string') response = { content: response }\n // If user provides an object, determine if it should be an autocomplete or a modal response\n else if (response.title) type = InteractionResponseTypes.Modal\n else if (this.type === InteractionTypes.ApplicationCommandAutocomplete) type = InteractionResponseTypes.ApplicationCommandAutocompleteResult\n\n // If user wants to send a private message\n if (type === InteractionResponseTypes.ChannelMessageWithSource && options?.isPrivate) response.flags = 64\n\n // Since this has already been given a response, any further responses must be followups.\n if (this.acknowledged) return await this.bot?.rest.sendFollowupMessage(this.token!, response)\n\n // Modals cannot be chained\n if (this.type === InteractionTypes.ModalSubmit && type === InteractionResponseTypes.Modal)\n throw new Error('Cannot respond to a modal interaction with another modal.')\n\n // Autocomplete response can only be used for autocomplete interactions\n if (this.type === InteractionTypes.ApplicationCommandAutocomplete && type !== InteractionResponseTypes.ApplicationCommandAutocompleteResult)\n throw new Error('Cannot respond to an autocomplete interaction with a modal or message.')\n\n // If user has not already responded to this interaction we need to send an original response\n this.acknowledged = true\n return await this.bot?.rest.sendInteractionResponse(this.id!, this.token!, { type, data: response })\n },\n\n async edit(response) {\n if (this.type === InteractionTypes.ApplicationCommandAutocomplete) throw new Error('Cannot edit an autocomplete interaction')\n\n // If user provides a string, change it to a response object\n if (typeof response === 'string') response = { content: response }\n\n return await this.bot!.rest.editOriginalInteractionResponse(this.token!, response)\n },\n\n async defer(isPrivate) {\n if (this.type === InteractionTypes.ApplicationCommandAutocomplete) throw new Error('Cannot defer an autocomplete interaction')\n if (this.acknowledged) throw new Error('Cannot defer an already responded interaction')\n\n // Determine the type of defer response\n const type =\n this.type === InteractionTypes.MessageComponent\n ? InteractionResponseTypes.DeferredUpdateMessage\n : InteractionResponseTypes.DeferredChannelMessageWithSource\n\n // If user wants to send a private message\n const data: InteractionCallbackData = {}\n if (isPrivate) data.flags = 64\n\n this.acknowledged = true\n return await this.bot?.rest.sendInteractionResponse(this.id!, this.token!, { type, data })\n },\n\n async delete(messageId?: BigString) {\n if (this.type === InteractionTypes.ApplicationCommandAutocomplete) throw new Error('Cannot delete an autocomplete interaction')\n\n if (messageId) return await this.bot?.rest.deleteFollowupMessage(this.token!, messageId)\n else return await this.bot?.rest.deleteOriginalInteractionResponse(this.token!)\n },\n}\n\nexport function transformInteraction(bot: Bot, payload: DiscordInteraction): Interaction {\n const guildId = payload.guild_id ? bot.transformers.snowflake(payload.guild_id) : undefined\n const user = bot.transformers.user(bot, payload.member?.user ?? payload.user!)\n\n const interaction: Interaction = Object.create(baseInteraction)\n const props = bot.transformers.desiredProperties.interaction\n interaction.bot = bot\n interaction.acknowledged = false\n\n if (payload.id && props.id) interaction.id = bot.transformers.snowflake(payload.id)\n if (payload.application_id && props.applicationId) interaction.applicationId = bot.transformers.snowflake(payload.application_id)\n if (payload.type && props.type) interaction.type = payload.type\n if (payload.token && props.token) interaction.token = payload.token\n if (payload.version && props.version) interaction.version = payload.version\n if (payload.locale && props.locale) interaction.locale = payload.locale\n if (payload.guild_locale && props.guildLocale) interaction.guildLocale = payload.guild_locale\n if (guildId && props.guildId) interaction.guildId = guildId\n if (props.user) interaction.user = user\n if (payload.app_permissions && props.appPermissions) interaction.appPermissions = bot.transformers.snowflake(payload.app_permissions)\n if (payload.message && props.message) interaction.message = bot.transformers.message(bot, payload.message)\n if (payload.channel_id && props.channelId) interaction.channelId = bot.transformers.snowflake(payload.channel_id)\n if (payload.member && guildId && props.member) interaction.member = bot.transformers.member(bot, payload.member, guildId, user.id)\n if (payload.data && props.data) {\n interaction.data = {\n type: payload.data.type,\n componentType: payload.data.component_type,\n customId: payload.data.custom_id,\n components: payload.data.components?.map((component) => bot.transformers.component(bot, component)),\n values: payload.data.values,\n id: payload.data.id ? bot.transformers.snowflake(payload.data.id) : undefined,\n name: payload.data.name,\n resolved: payload.data.resolved ? transformInteractionDataResolved(bot, payload.data.resolved, guildId) : undefined,\n options: payload.data.options?.map((opt) => bot.transformers.interactionDataOptions(bot, opt)),\n targetId: payload.data.target_id ? bot.transformers.snowflake(payload.data.target_id) : undefined,\n // guildId: payload.data.guild_id ? bot.transformers.snowflake(payload.data.guild_id) : undefined,\n }\n }\n\n return bot.transformers.customizers.interaction(bot, payload, interaction)\n}\n\nexport function transformInteractionDataOption(bot: Bot, option: DiscordInteractionDataOption): InteractionDataOption {\n const opt = {\n name: option.name,\n type: option.type,\n value: option.value,\n options: option.options,\n focused: option.focused,\n }\n\n return opt\n}\n\nexport function transformInteractionDataResolved(bot: Bot, resolved: DiscordInteractionDataResolved, guildId?: bigint): InteractionDataResolved {\n const transformed: InteractionDataResolved = {}\n\n if (resolved.messages) {\n transformed.messages = new Collection(\n Object.entries(resolved.messages).map(([id, value]) => {\n const message: Message = bot.transformers.message(bot, value)\n return [message.id, message]\n }),\n )\n }\n\n if (resolved.users) {\n transformed.users = new Collection(\n Object.entries(resolved.users).map(([id, value]) => {\n const user = bot.transformers.user(bot, value)\n return [user.id, user]\n }),\n )\n }\n\n if (guildId && resolved.members) {\n transformed.members = new Collection(\n Object.entries(resolved.members).map(([id, value]) => {\n const member: Member = bot.transformers.member(bot, value, guildId, bot.transformers.snowflake(id))\n return [member.id, member]\n }),\n )\n }\n\n if (guildId && resolved.roles) {\n transformed.roles = new Collection(\n Object.entries(resolved.roles).map(([id, value]) => {\n const role = bot.transformers.role(bot, { role: value, guildId })\n return [role.id, role]\n }),\n )\n }\n\n if (resolved.channels) {\n transformed.channels = new Collection(\n Object.entries(resolved.channels).map(([key, value]) => {\n const id = bot.transformers.snowflake(key)\n const channel = value as {\n id: string\n name: string\n type: ChannelTypes\n permissions: string\n }\n return [\n id,\n {\n id,\n name: channel.name,\n type: channel.type,\n permissions: bot.transformers.snowflake(channel.permissions),\n },\n ]\n }),\n )\n }\n\n if (resolved.attachments) {\n transformed.attachments = new Collection(\n Object.entries(resolved.attachments).map(([key, value]) => {\n const id = bot.transformers.snowflake(key)\n return [id, bot.transformers.attachment(bot, value)]\n }),\n )\n }\n\n return transformed\n}\n\nexport interface InteractionDataResolved {\n messages?: Collection<bigint, Message>\n users?: Collection<bigint, User>\n members?: Collection<bigint, Member>\n roles?: Collection<bigint, Role>\n channels?: Collection<bigint, { id: bigint; name: string; type: ChannelTypes; permissions: bigint }>\n attachments?: Collection<bigint, Attachment>\n}\n\nexport interface InteractionDataOption {\n name: string\n type: ApplicationCommandOptionTypes\n value?: string | number | boolean\n options?: InteractionDataOption[]\n focused?: boolean\n}\n"],"names":["InteractionResponseTypes","InteractionTypes","Collection","baseInteraction","respond","response","options","type","ChannelMessageWithSource","content","title","Modal","ApplicationCommandAutocomplete","ApplicationCommandAutocompleteResult","isPrivate","flags","acknowledged","bot","rest","sendFollowupMessage","token","ModalSubmit","Error","sendInteractionResponse","id","data","edit","editOriginalInteractionResponse","defer","MessageComponent","DeferredUpdateMessage","DeferredChannelMessageWithSource","delete","messageId","deleteFollowupMessage","deleteOriginalInteractionResponse","transformInteraction","payload","guildId","guild_id","transformers","snowflake","undefined","user","member","interaction","Object","create","props","desiredProperties","application_id","applicationId","version","locale","guild_locale","guildLocale","app_permissions","appPermissions","message","channel_id","channelId","componentType","component_type","customId","custom_id","components","map","component","values","name","resolved","transformInteractionDataResolved","opt","interactionDataOptions","targetId","target_id","customizers","transformInteractionDataOption","option","value","focused","transformed","messages","entries","users","members","roles","role","channels","key","channel","permissions","attachments","attachment"],"mappings":"AAAA,SACEA,wBAAwB,EACxBC,gBAAgB,QAUX,oBAAmB;AAC1B,SAASC,UAAU,QAAQ,oBAAmB;AAmE9C,MAAMC,kBAA0D;IAC9D,MAAMC,SAAQC,QAAQ,EAAEC,OAAO,EAAE;QAC/B,IAAIC,OAAOP,yBAAyBQ,wBAAwB;QAE5D,4DAA4D;QAC5D,IAAI,OAAOH,aAAa,UAAUA,WAAW;YAAEI,SAASJ;QAAS;aAE5D,IAAIA,SAASK,KAAK,EAAEH,OAAOP,yBAAyBW,KAAK;aACzD,IAAI,IAAI,CAACJ,IAAI,KAAKN,iBAAiBW,8BAA8B,EAAEL,OAAOP,yBAAyBa,oCAAoC;QAE5I,0CAA0C;QAC1C,IAAIN,SAASP,yBAAyBQ,wBAAwB,IAAIF,SAASQ,WAAWT,SAASU,KAAK,GAAG;QAEvG,yFAAyF;QACzF,IAAI,IAAI,CAACC,YAAY,EAAE,OAAO,MAAM,IAAI,CAACC,GAAG,EAAEC,KAAKC,mBAAmB,CAAC,IAAI,CAACC,KAAK,EAAGf;QAEpF,2BAA2B;QAC3B,IAAI,IAAI,CAACE,IAAI,KAAKN,iBAAiBoB,WAAW,IAAId,SAASP,yBAAyBW,KAAK,EACvF,MAAM,IAAIW,MAAM,6DAA4D;QAE9E,uEAAuE;QACvE,IAAI,IAAI,CAACf,IAAI,KAAKN,iBAAiBW,8BAA8B,IAAIL,SAASP,yBAAyBa,oCAAoC,EACzI,MAAM,IAAIS,MAAM,0EAAyE;QAE3F,6FAA6F;QAC7F,IAAI,CAACN,YAAY,GAAG,IAAI;QACxB,OAAO,MAAM,IAAI,CAACC,GAAG,EAAEC,KAAKK,uB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;oBAClB9D,MAAMmF,QAAQnF,IAAI;oBAClBoF,aAAa1E,IAAIuB,YAAY,CAACC,SAAS,CAACiD,QAAQC,WAAW;gBAC7D;aACD;QACH;IAEJ,CAAC;IAED,IAAIrB,SAASsB,WAAW,EAAE;QACxBX,YAAYW,WAAW,GAAG,IAAI1F,WAC5B4C,OAAOqC,OAAO,CAACb,SAASsB,WAAW,EAAE1B,GAAG,CAAC,CAAC,CAACuB,KAAKV,MAAM,GAAK;YACzD,MAAMvD,KAAKP,IAAIuB,YAAY,CAACC,SAAS,CAACgD;YACtC,OAAO;gBAACjE;gBAAIP,IAAIuB,YAAY,CAACqD,UAAU,CAAC5E,KAAK8D;aAAO;QACtD;IAEJ,CAAC;IAED,OAAOE;AACT,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/transformers/reverse/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,wBAAgB,oCAAoC,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,GAAG,gBAAgB,CAqCnG"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/transformers/reverse/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,wBAAgB,oCAAoC,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,GAAG,gBAAgB,CAsCnG"}
@@ -12,6 +12,7 @@ export function transformComponentToDiscordComponent(bot, payload) {
12
12
  animated: payload.emoji.animated
13
13
  } : undefined,
14
14
  url: payload.url,
15
+ channel_types: payload.channelTypes,
15
16
  options: payload.options?.map((option)=>({
16
17
  label: option.label,
17
18
  value: option.value,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/transformers/reverse/component.ts"],"sourcesContent":["import type { Bot } from '../../index.js'\nimport type { DiscordComponent } from '../../typings.js'\nimport type { Component } from '../component.js'\n\nexport function transformComponentToDiscordComponent(bot: Bot, payload: Component): DiscordComponent {\n return {\n type: payload.type,\n custom_id: payload.customId,\n disabled: payload.disabled,\n required: payload.required,\n style: payload.style,\n label: payload.label,\n emoji: payload.emoji\n ? {\n id: payload.emoji.id?.toString(),\n name: payload.emoji.name,\n animated: payload.emoji.animated,\n }\n : undefined,\n url: payload.url,\n options: payload.options?.map((option) => ({\n label: option.label,\n value: option.value,\n description: option.description,\n emoji: option.emoji\n ? {\n id: option.emoji.id?.toString(),\n name: option.emoji.name,\n animated: option.emoji.animated,\n }\n : undefined,\n default: option.default,\n })),\n placeholder: payload.placeholder,\n min_values: payload.minValues,\n max_values: payload.maxValues,\n min_length: payload.minLength,\n max_length: payload.maxLength,\n value: payload.value,\n components: payload.components?.map((component) => bot.transformers.reverse.component(bot, component)),\n }\n}\n"],"names":["transformComponentToDiscordComponent","bot","payload","type","custom_id","customId","disabled","required","style","label","emoji","id","toString","name","animated","undefined","url","options","map","option","value","description","default","placeholder","min_values","minValues","max_values","maxValues","min_length","minLength","max_length","maxLength","components","component","transformers","reverse"],"mappings":"AAIA,OAAO,SAASA,qCAAqCC,GAAQ,EAAEC,OAAkB,EAAoB;IACnG,OAAO;QACLC,MAAMD,QAAQC,IAAI;QAClBC,WAAWF,QAAQG,QAAQ;QAC3BC,UAAUJ,QAAQI,QAAQ;QAC1BC,UAAUL,QAAQK,QAAQ;QAC1BC,OAAON,QAAQM,KAAK;QACpBC,OAAOP,QAAQO,KAAK;QACpBC,OAAOR,QAAQQ,KAAK,GAChB;YACEC,IAAIT,QAAQQ,KAAK,CAACC,EAAE,EAAEC;YACtBC,MAAMX,QAAQQ,KAAK,CAACG,IAAI;YACxBC,UAAUZ,QAAQQ,KAAK,CAACI,QAAQ;QAClC,IACAC,SAAS;QACbC,KAAKd,QAAQc,GAAG;QAChBC,SAASf,QAAQe,OAAO,EAAEC,IAAI,CAACC,SAAY,CAAA;gBACzCV,OAAOU,OAAOV,KAAK;gBACnBW,OAAOD,OAAOC,KAAK;gBACnBC,aAAaF,OAAOE,WAAW;gBAC/BX,OAAOS,OAAOT,KAAK,GACf;oBACEC,IAAIQ,OAAOT,KAAK,CAACC,EAAE,EAAEC;oBACrBC,MAAMM,OAAOT,KAAK,CAACG,IAAI;oBACvBC,UAAUK,OAAOT,KAAK,CAACI,QAAQ;gBACjC,IACAC,SAAS;gBACbO,SAASH,OAAOG,OAAO;YACzB,CAAA;QACAC,aAAarB,QAAQqB,WAAW;QAChCC,YAAYtB,QAAQuB,SAAS;QAC7BC,YAAYxB,QAAQyB,SAAS;QAC7BC,YAAY1B,QAAQ2B,SAAS;QAC7BC,YAAY5B,QAAQ6B,SAAS;QAC7BX,OAAOlB,QAAQkB,KAAK;QACpBY,YAAY9B,QAAQ8B,UAAU,EAAEd,IAAI,CAACe,YAAchC,IAAIiC,YAAY,CAACC,OAAO,CAACF,SAAS,CAAChC,KAAKgC;IAC7F;AACF,CAAC"}
1
+ {"version":3,"sources":["../../../src/transformers/reverse/component.ts"],"sourcesContent":["import type { Bot } from '../../index.js'\nimport type { DiscordComponent } from '../../typings.js'\nimport type { Component } from '../component.js'\n\nexport function transformComponentToDiscordComponent(bot: Bot, payload: Component): DiscordComponent {\n return {\n type: payload.type,\n custom_id: payload.customId,\n disabled: payload.disabled,\n required: payload.required,\n style: payload.style,\n label: payload.label,\n emoji: payload.emoji\n ? {\n id: payload.emoji.id?.toString(),\n name: payload.emoji.name,\n animated: payload.emoji.animated,\n }\n : undefined,\n url: payload.url,\n channel_types: payload.channelTypes,\n options: payload.options?.map((option) => ({\n label: option.label,\n value: option.value,\n description: option.description,\n emoji: option.emoji\n ? {\n id: option.emoji.id?.toString(),\n name: option.emoji.name,\n animated: option.emoji.animated,\n }\n : undefined,\n default: option.default,\n })),\n placeholder: payload.placeholder,\n min_values: payload.minValues,\n max_values: payload.maxValues,\n min_length: payload.minLength,\n max_length: payload.maxLength,\n value: payload.value,\n components: payload.components?.map((component) => bot.transformers.reverse.component(bot, component)),\n }\n}\n"],"names":["transformComponentToDiscordComponent","bot","payload","type","custom_id","customId","disabled","required","style","label","emoji","id","toString","name","animated","undefined","url","channel_types","channelTypes","options","map","option","value","description","default","placeholder","min_values","minValues","max_values","maxValues","min_length","minLength","max_length","maxLength","components","component","transformers","reverse"],"mappings":"AAIA,OAAO,SAASA,qCAAqCC,GAAQ,EAAEC,OAAkB,EAAoB;IACnG,OAAO;QACLC,MAAMD,QAAQC,IAAI;QAClBC,WAAWF,QAAQG,QAAQ;QAC3BC,UAAUJ,QAAQI,QAAQ;QAC1BC,UAAUL,QAAQK,QAAQ;QAC1BC,OAAON,QAAQM,KAAK;QACpBC,OAAOP,QAAQO,KAAK;QACpBC,OAAOR,QAAQQ,KAAK,GAChB;YACEC,IAAIT,QAAQQ,KAAK,CAACC,EAAE,EAAEC;YACtBC,MAAMX,QAAQQ,KAAK,CAACG,IAAI;YACxBC,UAAUZ,QAAQQ,KAAK,CAACI,QAAQ;QAClC,IACAC,SAAS;QACbC,KAAKd,QAAQc,GAAG;QAChBC,eAAef,QAAQgB,YAAY;QACnCC,SAASjB,QAAQiB,OAAO,EAAEC,IAAI,CAACC,SAAY,CAAA;gBACzCZ,OAAOY,OAAOZ,KAAK;gBACnBa,OAAOD,OAAOC,KAAK;gBACnBC,aAAaF,OAAOE,WAAW;gBAC/Bb,OAAOW,OAAOX,KAAK,GACf;oBACEC,IAAIU,OAAOX,KAAK,CAACC,EAAE,EAAEC;oBACrBC,MAAMQ,OAAOX,KAAK,CAACG,IAAI;oBACvBC,UAAUO,OAAOX,KAAK,CAACI,QAAQ;gBACjC,IACAC,SAAS;gBACbS,SAASH,OAAOG,OAAO;YACzB,CAAA;QACAC,aAAavB,QAAQuB,WAAW;QAChCC,YAAYxB,QAAQyB,SAAS;QAC7BC,YAAY1B,QAAQ2B,SAAS;QAC7BC,YAAY5B,QAAQ6B,SAAS;QAC7BC,YAAY9B,QAAQ+B,SAAS;QAC7BX,OAAOpB,QAAQoB,KAAK;QACpBY,YAAYhC,QAAQgC,UAAU,EAAEd,IAAI,CAACe,YAAclC,IAAImC,YAAY,CAACC,OAAO,CAACF,SAAS,CAAClC,KAAKkC;IAC7F;AACF,CAAC"}
@@ -123,7 +123,7 @@ export declare function transformTemplate(bot: Bot, payload: DiscordTemplate): {
123
123
  emoji_id: string;
124
124
  } | null | undefined;
125
125
  default_sort_order?: import("@discordeno/types").SortOrderTypes | null | undefined;
126
- default_forum_layout?: import("@discordeno/types").FormLayout | undefined;
126
+ default_forum_layout?: import("@discordeno/types").ForumLayout | undefined;
127
127
  newly_created?: boolean | undefined;
128
128
  id: string;
129
129
  type: import("@discordeno/types").ChannelTypes;
@@ -309,7 +309,7 @@ export declare function transformTemplate(bot: Bot, payload: DiscordTemplate): {
309
309
  emoji_id: string;
310
310
  } | null | undefined;
311
311
  default_sort_order?: import("@discordeno/types").SortOrderTypes | null | undefined;
312
- default_forum_layout?: import("@discordeno/types").FormLayout | undefined;
312
+ default_forum_layout?: import("@discordeno/types").ForumLayout | undefined;
313
313
  newly_created?: boolean | undefined;
314
314
  id: string;
315
315
  type: import("@discordeno/types").ChannelTypes;
package/dist/typings.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { type AllowedMentions, type ButtonStyles, type CreateApplicationCommand, type CreateContextApplicationCommand, type DiscordAllowedMentions, type DiscordApplicationCommandOptionChoice, type DiscordAttachment, type DiscordChannel, type DiscordEmbed, type DiscordInteractionMember, type DiscordMessage, type DiscordRole, type DiscordSelectOption, type DiscordUser, type FileContent, type InteractionResponseTypes, type MessageComponents, type MessageComponentTypes, type TextStyles } from '@discordeno/types';
1
+ import { type AllowedMentions, type ButtonStyles, type ChannelTypes, type CreateApplicationCommand, type CreateContextApplicationCommand, type DiscordAllowedMentions, type DiscordApplicationCommandOptionChoice, type DiscordAttachment, type DiscordChannel, type DiscordEmbed, type DiscordInteractionMember, type DiscordMessage, type DiscordRole, type DiscordSelectOption, type DiscordUser, type FileContent, type InteractionResponseTypes, type MessageComponentTypes, type MessageComponents, type TextStyles } from '@discordeno/types';
2
2
  import type * as handlers from './handlers/index.js';
3
- import type { Embed } from './transformers/embed.js';
4
3
  import type { ApplicationCommandOptionChoice } from './transformers/applicationCommandOptionChoice.js';
4
+ import type { Embed } from './transformers/embed.js';
5
5
  export declare function isContextApplicationCommand(command: CreateApplicationCommand): command is CreateContextApplicationCommand;
6
6
  export interface DiscordInteractionResponse {
7
7
  type: InteractionResponseTypes;
@@ -42,6 +42,8 @@ export interface DiscordComponent {
42
42
  };
43
43
  /** optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url */
44
44
  url?: string;
45
+ /** List of channel types to include in a channel select menu options list */
46
+ channel_types?: ChannelTypes[];
45
47
  /** The choices! Maximum of 25 items. */
46
48
  options?: DiscordSelectOption[];
47
49
  /** A custom placeholder text if nothing is selected. Maximum 150 characters. */
@@ -1 +1 @@
1
- {"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../src/typings.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,sBAAsB,EAC3B,KAAK,qCAAqC,EAC1C,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,qBAA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AAQ,CAAC,uBAAuB,CAAA;IAC5D,kBAAkB,EAAE,OAAO,QAAQ,CAAC,sBAAsB,CAAA;IAC1D,eAAe,EAAE,OAAO,QAAQ,CAAC,oBAAoB,CAAA;IACrD,kBAAkB,EAAE,OAAO,QAAQ,CAAC,uBAAuB,CAAA;IAC3D,kBAAkB,EAAE,OAAO,QAAQ,CAAC,uBAAuB,CAAA;IAC3D,kBAAkB,EAAE,OAAO,QAAQ,CAAC,uBAAuB,CAAA;CAC5D;AAED,oBAAY,YAAY;IACtB,6FAA6F;IAC7F,WAAW,IAAS;IACpB,gGAAgG;IAChG,WAAW,IAAS;IACpB,sEAAsE;IACtE,cAAc,IAAS;IACvB,6FAA6F;IAC7F,oBAAoB,IAAS;IAC7B,+DAA+D;IAC/D,MAAM,KAAS;IACf,qFAAqF;IACrF,SAAS,KAAS;IAClB,mFAAmF;IACnF,SAAS,KAAS;IAClB,gFAAgF;IAChF,OAAO,MAAS;IAChB,4FAA4F;IAC5F,gCAAgC,MAAS;IACzC,2EAA2E;IAC3E,qBAAqB,OAAU;CAChC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/typings.ts"],"sourcesContent":["import {\n ApplicationCommandTypes,\n type AllowedMentions,\n type ButtonStyles,\n type CreateApplicationCommand,\n type CreateContextApplicationCommand,\n type DiscordAllowedMentions,\n type DiscordApplicationCommandOptionChoice,\n type DiscordAttachment,\n type DiscordChannel,\n type DiscordEmbed,\n type DiscordInteractionMember,\n type DiscordMessage,\n type DiscordRole,\n type DiscordSelectOption,\n type DiscordUser,\n type FileContent,\n type InteractionResponseTypes,\n type MessageComponents,\n type MessageComponentTypes,\n type TextStyles,\n} from '@discordeno/types'\nimport type * as handlers from './handlers/index.js'\nimport type { Embed } from './transformers/embed.js'\nimport type { ApplicationCommandOptionChoice } from './transformers/applicationCommandOptionChoice.js'\n\nexport function isContextApplicationCommand(command: CreateApplicationCommand): command is CreateContextApplicationCommand {\n return command.type === ApplicationCommandTypes.Message || command.type === ApplicationCommandTypes.User\n}\n\nexport interface DiscordInteractionResponse {\n type: InteractionResponseTypes\n data?: DiscordInteractionCallbackData\n}\n\nexport interface DiscordInteractionCallbackData {\n tts?: boolean\n title?: string\n flags?: number\n content?: string\n choices?: DiscordApplicationCommandOptionChoice[]\n custom_id?: string\n embeds?: DiscordEmbed[]\n allowed_mentions?: DiscordAllowedMentions\n components?: DiscordComponent[]\n}\n\nexport interface DiscordComponent {\n /** component type */\n type: MessageComponentTypes\n /** a developer-defined identifier for the component, max 100 characters */\n custom_id?: string\n /** whether the component is disabled, default false */\n disabled?: boolean\n /** For different styles/colors of the buttons */\n style?: ButtonStyles | TextStyles\n /** text that appears on the button (max 80 characters) */\n label?: string\n /** the dev-define value of the option, max 100 characters for select or 4000 for input. */\n value?: string\n /** Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis. */\n emoji?: {\n /** Emoji id */\n id?: string\n /** Emoji name */\n name?: string\n /** Whether this emoji is animated */\n animated?: boolean\n }\n /** optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url */\n url?: string\n /** The choices! Maximum of 25 items. */\n options?: DiscordSelectOption[]\n /** A custom placeholder text if nothing is selected. Maximum 150 characters. */\n placeholder?: string\n /** The minimum number of items that must be selected. Default 1. Between 1-25. */\n min_values?: number\n /** The maximum number of items that can be selected. Default 1. Between 1-25. */\n max_values?: number\n /** The minimum input length for a text input. Between 0-4000. */\n min_length?: number\n /** The maximum input length for a text input. Between 1-4000. */\n max_length?: number\n /** a list of child components */\n components?: DiscordComponent[]\n /** whether this component is required to be filled, default true */\n required?: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/slash-commands#interaction-response */\nexport interface BotInteractionResponse {\n /** The type of response */\n type: InteractionResponseTypes\n /** An optional response message */\n data?: BotInteractionCallbackData\n}\n\nexport interface BotInteractionCallbackData {\n /** The message contents (up to 2000 characters) */\n content?: string\n /** True if this is a TTS message */\n tts?: boolean\n /** Embedded `rich` content (up to 6000 characters) */\n embeds?: Embed[]\n /** Allowed mentions for the message */\n allowedMentions?: AllowedMentions\n /** The contents of the files being sent */\n files?: FileContent[]\n /** The customId you want to use for this modal response. */\n customId?: string\n /** The title you want to use for this modal response. */\n title?: string\n /** The components you would like to have sent in this message */\n components?: MessageComponents\n /** Message flags combined as a bit field (only SUPPRESS_EMBEDS and EPHEMERAL can be set) */\n flags?: number\n /** Autocomplete choices (max of 25 choices) */\n choices?: ApplicationCommandOptionChoice[]\n}\n\nexport interface DiscordInteractionDataResolved {\n /** The Ids and Message objects */\n messages?: Record<string, DiscordMessage>\n /** The Ids and User objects */\n users?: Record<string, DiscordUser>\n /** The Ids and partial Member objects */\n members?: Record<string, Omit<DiscordInteractionMember, 'user' | 'deaf' | 'mute'>>\n /** The Ids and Role objects */\n roles?: Record<string, DiscordRole>\n /** The Ids and partial Channel objects */\n channels?: Record<string, Pick<DiscordChannel, 'id' | 'name' | 'type' | 'permissions'>>\n /** The Ids and attachments objects */\n attachments?: Record<string, DiscordAttachment>\n}\n\nexport interface DiscordThreadMemberGuildCreate {\n /** Any user-thread settings, currently only used for notifications */\n flags: number\n /** The time the current user last joined the thread */\n join_timestamp: string\n}\n\nexport interface BotGatewayHandlerOptions {\n READY: typeof handlers.handleReady\n APPLICATION_COMMAND_PERMISSIONS_UPDATE: typeof handlers.handleApplicationCommandPermissionsUpdate\n AUTO_MODERATION_ACTION_EXECUTION: typeof handlers.handleAutoModerationActionExecution\n AUTO_MODERATION_RULE_CREATE: typeof handlers.handleAutoModerationRuleCreate\n AUTO_MODERATION_RULE_DELETE: typeof handlers.handleAutoModerationRuleDelete\n AUTO_MODERATION_RULE_UPDATE: typeof handlers.handleAutoModerationRuleUpdate\n\n CHANNEL_CREATE: typeof handlers.handleChannelCreate\n CHANNEL_DELETE: typeof handlers.handleChannelDelete\n CHANNEL_PINS_UPDATE: typeof handlers.handleChannelPinsUpdate\n CHANNEL_UPDATE: typeof handlers.handleChannelUpdate\n THREAD_CREATE: typeof handlers.handleThreadCreate\n THREAD_UPDATE: typeof handlers.handleThreadUpdate\n THREAD_DELETE: typeof handlers.handleThreadDelete\n THREAD_LIST_SYNC: typeof handlers.handleThreadListSync\n THREAD_MEMBERS_UPDATE: typeof handlers.handleThreadMembersUpdate\n STAGE_INSTANCE_CREATE: typeof handlers.handleStageInstanceCreate\n STAGE_INSTANCE_UPDATE: typeof handlers.handleStageInstanceUpdate\n STAGE_INSTANCE_DELETE: typeof handlers.handleStageInstanceDelete\n GUILD_AUDIT_LOG_ENTRY_CREATE: typeof handlers.handleGuildAuditLogEntryCreate\n GUILD_BAN_ADD: typeof handlers.handleGuildBanAdd\n GUILD_BAN_REMOVE: typeof handlers.handleGuildBanRemove\n GUILD_CREATE: typeof handlers.handleGuildCreate\n GUILD_DELETE: typeof handlers.handleGuildDelete\n GUILD_EMOJIS_UPDATE: typeof handlers.handleGuildEmojisUpdate\n GUILD_INTEGRATIONS_UPDATE: typeof handlers.handleGuildIntegrationsUpdate\n GUILD_MEMBER_ADD: typeof handlers.handleGuildMemberAdd\n GUILD_MEMBER_REMOVE: typeof handlers.handleGuildMemberRemove\n GUILD_MEMBER_UPDATE: typeof handlers.handleGuildMemberUpdate\n GUILD_MEMBERS_CHUNK: typeof handlers.handleGuildMembersChunk\n GUILD_ROLE_CREATE: typeof handlers.handleGuildRoleCreate\n GUILD_ROLE_DELETE: typeof handlers.handleGuildRoleDelete\n GUILD_ROLE_UPDATE: typeof handlers.handleGuildRoleUpdate\n GUILD_SCHEDULED_EVENT_CREATE: typeof handlers.handleGuildScheduledEventCreate\n GUILD_SCHEDULED_EVENT_DELETE: typeof handlers.handleGuildScheduledEventDelete\n GUILD_SCHEDULED_EVENT_UPDATE: typeof handlers.handleGuildScheduledEventUpdate\n GUILD_SCHEDULED_EVENT_USER_ADD: typeof handlers.handleGuildScheduledEventUserAdd\n GUILD_SCHEDULED_EVENT_USER_REMOVE: typeof handlers.handleGuildScheduledEventUserRemove\n GUILD_STICKERS_UPDATE: typeof handlers.handleGuildStickersUpdate\n GUILD_UPDATE: typeof handlers.handleGuildUpdate\n INTERACTION_CREATE: typeof handlers.handleInteractionCreate\n INVITE_CREATE: typeof handlers.handleInviteCreate\n INVITE_DELETE: typeof handlers.handleInviteCreate\n MESSAGE_CREATE: typeof handlers.handleMessageCreate\n MESSAGE_DELETE_BULK: typeof handlers.handleMessageDeleteBulk\n MESSAGE_DELETE: typeof handlers.handleMessageDelete\n MESSAGE_REACTION_ADD: typeof handlers.handleMessageReactionAdd\n MESSAGE_REACTION_REMOVE_ALL: typeof handlers.handleMessageReactionRemoveAll\n MESSAGE_REACTION_REMOVE_EMOJI: typeof handlers.handleMessageReactionRemoveEmoji\n MESSAGE_REACTION_REMOVE: typeof handlers.handleMessageReactionRemove\n MESSAGE_UPDATE: typeof handlers.handleMessageUpdate\n PRESENCE_UPDATE: typeof handlers.handlePresenceUpdate\n TYPING_START: typeof handlers.handleTypingStart\n USER_UPDATE: typeof handlers.handleUserUpdate\n VOICE_SERVER_UPDATE: typeof handlers.handleVoiceServerUpdate\n VOICE_STATE_UPDATE: typeof handlers.handleVoiceStateUpdate\n WEBHOOKS_UPDATE: typeof handlers.handleWebhooksUpdate\n INTEGRATION_CREATE: typeof handlers.handleIntegrationCreate\n INTEGRATION_UPDATE: typeof handlers.handleIntegrationUpdate\n INTEGRATION_DELETE: typeof handlers.handleIntegrationDelete\n}\n\nexport enum MessageFlags {\n /** Whether this message has been published to subscribed channels (via Channel Following) */\n Crossposted =\t1 << 0,\t\n /** Whether this message originated from a message in another channel (via Channel Following) */\n IsCrosspost = 1 << 1,\n /** Whether do not include any embeds when serializing this message */\n SuppressEmbeds = 1 << 2,\n /** Whether the source message for this crosspost has been deleted (via Channel Following) */\n SourceMessageDeleted = 1 << 3,\n /** Whether this message came from the urgent message system */\n Urgent = 1 << 4,\n /** Whether this message has an associated thread, with the same id as the message */\n HasThread = 1 << 5,\n /** Whether this message is only visible to the user who invoked the Interaction */\n Ephemeral = 1 << 6,\n /** Whether this message is an Interaction Response and the bot is \"thinking\" */\n Loading = 1 << 7,\n /** Whether this message failed to mention some roles and add their members to the thread */\n FailedToMentionSomeRolesInThread = 1 << 8,\n /** Whether this message will not trigger push and desktop notifications */\n SuppressNotifications = 1 << 12,\n}\n"],"names":["ApplicationCommandTypes","isContextApplicationCommand","command","type","Message","User","MessageFlags","Crossposted","IsCrosspost","SuppressEmbeds","SourceMessageDeleted","Urgent","HasThread","Ephemeral","Loading","FailedToMentionSomeRolesInThread","SuppressNotifications"],"mappings":"AAAA,SACEA,uBAAuB,QAoBlB,oBAAmB;AAK1B,OAAO,SAASC,4BAA4BC,OAAiC,EAA8C;IACzH,OAAOA,QAAQC,IAAI,KAAKH,wBAAwBI,OAAO,IAAIF,QAAQC,IAAI,KAAKH,wBAAwBK,IAAI;AAC1G,CAAC;WAiLM;UAAKC,YAAY;IAAZA,aAAAA,aACV,2FAA2F,GAC3FC,iBAAAA,KAAAA;IAFUD,aAAAA,aAGV,8FAA8F,GAC9FE,iBAAAA,KAAAA;IAJUF,aAAAA,aAKV,oEAAoE,GACpEG,oBAAAA,KAAAA;IANUH,aAAAA,aAOV,2FAA2F,GAC3FI,0BAAAA,KAAAA;IARUJ,aAAAA,aASV,6DAA6D,GAC7DK,YAAAA,MAAAA;IAVUL,aAAAA,aAWV,mFAAmF,GACnFM,eAAAA,MAAAA;IAZUN,aAAAA,aAaV,iFAAiF,GACjFO,eAAAA,MAAAA;IAdUP,aAAAA,aAeV,8EAA8E,GAC9EQ,aAAAA,OAAAA;IAhBUR,aAAAA,aAiBV,0FAA0F,GAC1FS,sCAAAA,OAAAA;IAlBUT,aAAAA,aAmBV,yEAAyE,GACzEU,2BAAAA,QAAAA;GApBUV,iBAAAA"}
1
+ {"version":3,"sources":["../src/typings.ts"],"sourcesContent":["import {\n ApplicationCommandTypes,\n type AllowedMentions,\n type ButtonStyles,\n type ChannelTypes,\n type CreateApplicationCommand,\n type CreateContextApplicationCommand,\n type DiscordAllowedMentions,\n type DiscordApplicationCommandOptionChoice,\n type DiscordAttachment,\n type DiscordChannel,\n type DiscordEmbed,\n type DiscordInteractionMember,\n type DiscordMessage,\n type DiscordRole,\n type DiscordSelectOption,\n type DiscordUser,\n type FileContent,\n type InteractionResponseTypes,\n type MessageComponentTypes,\n type MessageComponents,\n type TextStyles,\n} from '@discordeno/types'\nimport type * as handlers from './handlers/index.js'\nimport type { ApplicationCommandOptionChoice } from './transformers/applicationCommandOptionChoice.js'\nimport type { Embed } from './transformers/embed.js'\n\nexport function isContextApplicationCommand(command: CreateApplicationCommand): command is CreateContextApplicationCommand {\n return command.type === ApplicationCommandTypes.Message || command.type === ApplicationCommandTypes.User\n}\n\nexport interface DiscordInteractionResponse {\n type: InteractionResponseTypes\n data?: DiscordInteractionCallbackData\n}\n\nexport interface DiscordInteractionCallbackData {\n tts?: boolean\n title?: string\n flags?: number\n content?: string\n choices?: DiscordApplicationCommandOptionChoice[]\n custom_id?: string\n embeds?: DiscordEmbed[]\n allowed_mentions?: DiscordAllowedMentions\n components?: DiscordComponent[]\n}\n\nexport interface DiscordComponent {\n /** component type */\n type: MessageComponentTypes\n /** a developer-defined identifier for the component, max 100 characters */\n custom_id?: string\n /** whether the component is disabled, default false */\n disabled?: boolean\n /** For different styles/colors of the buttons */\n style?: ButtonStyles | TextStyles\n /** text that appears on the button (max 80 characters) */\n label?: string\n /** the dev-define value of the option, max 100 characters for select or 4000 for input. */\n value?: string\n /** Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis. */\n emoji?: {\n /** Emoji id */\n id?: string\n /** Emoji name */\n name?: string\n /** Whether this emoji is animated */\n animated?: boolean\n }\n /** optional url for link-style buttons that can navigate a user to the web. Only type 5 Link buttons can have a url */\n url?: string\n /** List of channel types to include in a channel select menu options list */\n channel_types?: ChannelTypes[]\n /** The choices! Maximum of 25 items. */\n options?: DiscordSelectOption[]\n /** A custom placeholder text if nothing is selected. Maximum 150 characters. */\n placeholder?: string\n /** The minimum number of items that must be selected. Default 1. Between 1-25. */\n min_values?: number\n /** The maximum number of items that can be selected. Default 1. Between 1-25. */\n max_values?: number\n /** The minimum input length for a text input. Between 0-4000. */\n min_length?: number\n /** The maximum input length for a text input. Between 1-4000. */\n max_length?: number\n /** a list of child components */\n components?: DiscordComponent[]\n /** whether this component is required to be filled, default true */\n required?: boolean\n}\n\n/** https://discord.com/developers/docs/interactions/slash-commands#interaction-response */\nexport interface BotInteractionResponse {\n /** The type of response */\n type: InteractionResponseTypes\n /** An optional response message */\n data?: BotInteractionCallbackData\n}\n\nexport interface BotInteractionCallbackData {\n /** The message contents (up to 2000 characters) */\n content?: string\n /** True if this is a TTS message */\n tts?: boolean\n /** Embedded `rich` content (up to 6000 characters) */\n embeds?: Embed[]\n /** Allowed mentions for the message */\n allowedMentions?: AllowedMentions\n /** The contents of the files being sent */\n files?: FileContent[]\n /** The customId you want to use for this modal response. */\n customId?: string\n /** The title you want to use for this modal response. */\n title?: string\n /** The components you would like to have sent in this message */\n components?: MessageComponents\n /** Message flags combined as a bit field (only SUPPRESS_EMBEDS and EPHEMERAL can be set) */\n flags?: number\n /** Autocomplete choices (max of 25 choices) */\n choices?: ApplicationCommandOptionChoice[]\n}\n\nexport interface DiscordInteractionDataResolved {\n /** The Ids and Message objects */\n messages?: Record<string, DiscordMessage>\n /** The Ids and User objects */\n users?: Record<string, DiscordUser>\n /** The Ids and partial Member objects */\n members?: Record<string, Omit<DiscordInteractionMember, 'user' | 'deaf' | 'mute'>>\n /** The Ids and Role objects */\n roles?: Record<string, DiscordRole>\n /** The Ids and partial Channel objects */\n channels?: Record<string, Pick<DiscordChannel, 'id' | 'name' | 'type' | 'permissions'>>\n /** The Ids and attachments objects */\n attachments?: Record<string, DiscordAttachment>\n}\n\nexport interface DiscordThreadMemberGuildCreate {\n /** Any user-thread settings, currently only used for notifications */\n flags: number\n /** The time the current user last joined the thread */\n join_timestamp: string\n}\n\nexport interface BotGatewayHandlerOptions {\n READY: typeof handlers.handleReady\n APPLICATION_COMMAND_PERMISSIONS_UPDATE: typeof handlers.handleApplicationCommandPermissionsUpdate\n AUTO_MODERATION_ACTION_EXECUTION: typeof handlers.handleAutoModerationActionExecution\n AUTO_MODERATION_RULE_CREATE: typeof handlers.handleAutoModerationRuleCreate\n AUTO_MODERATION_RULE_DELETE: typeof handlers.handleAutoModerationRuleDelete\n AUTO_MODERATION_RULE_UPDATE: typeof handlers.handleAutoModerationRuleUpdate\n\n CHANNEL_CREATE: typeof handlers.handleChannelCreate\n CHANNEL_DELETE: typeof handlers.handleChannelDelete\n CHANNEL_PINS_UPDATE: typeof handlers.handleChannelPinsUpdate\n CHANNEL_UPDATE: typeof handlers.handleChannelUpdate\n THREAD_CREATE: typeof handlers.handleThreadCreate\n THREAD_UPDATE: typeof handlers.handleThreadUpdate\n THREAD_DELETE: typeof handlers.handleThreadDelete\n THREAD_LIST_SYNC: typeof handlers.handleThreadListSync\n THREAD_MEMBERS_UPDATE: typeof handlers.handleThreadMembersUpdate\n STAGE_INSTANCE_CREATE: typeof handlers.handleStageInstanceCreate\n STAGE_INSTANCE_UPDATE: typeof handlers.handleStageInstanceUpdate\n STAGE_INSTANCE_DELETE: typeof handlers.handleStageInstanceDelete\n GUILD_AUDIT_LOG_ENTRY_CREATE: typeof handlers.handleGuildAuditLogEntryCreate\n GUILD_BAN_ADD: typeof handlers.handleGuildBanAdd\n GUILD_BAN_REMOVE: typeof handlers.handleGuildBanRemove\n GUILD_CREATE: typeof handlers.handleGuildCreate\n GUILD_DELETE: typeof handlers.handleGuildDelete\n GUILD_EMOJIS_UPDATE: typeof handlers.handleGuildEmojisUpdate\n GUILD_INTEGRATIONS_UPDATE: typeof handlers.handleGuildIntegrationsUpdate\n GUILD_MEMBER_ADD: typeof handlers.handleGuildMemberAdd\n GUILD_MEMBER_REMOVE: typeof handlers.handleGuildMemberRemove\n GUILD_MEMBER_UPDATE: typeof handlers.handleGuildMemberUpdate\n GUILD_MEMBERS_CHUNK: typeof handlers.handleGuildMembersChunk\n GUILD_ROLE_CREATE: typeof handlers.handleGuildRoleCreate\n GUILD_ROLE_DELETE: typeof handlers.handleGuildRoleDelete\n GUILD_ROLE_UPDATE: typeof handlers.handleGuildRoleUpdate\n GUILD_SCHEDULED_EVENT_CREATE: typeof handlers.handleGuildScheduledEventCreate\n GUILD_SCHEDULED_EVENT_DELETE: typeof handlers.handleGuildScheduledEventDelete\n GUILD_SCHEDULED_EVENT_UPDATE: typeof handlers.handleGuildScheduledEventUpdate\n GUILD_SCHEDULED_EVENT_USER_ADD: typeof handlers.handleGuildScheduledEventUserAdd\n GUILD_SCHEDULED_EVENT_USER_REMOVE: typeof handlers.handleGuildScheduledEventUserRemove\n GUILD_STICKERS_UPDATE: typeof handlers.handleGuildStickersUpdate\n GUILD_UPDATE: typeof handlers.handleGuildUpdate\n INTERACTION_CREATE: typeof handlers.handleInteractionCreate\n INVITE_CREATE: typeof handlers.handleInviteCreate\n INVITE_DELETE: typeof handlers.handleInviteCreate\n MESSAGE_CREATE: typeof handlers.handleMessageCreate\n MESSAGE_DELETE_BULK: typeof handlers.handleMessageDeleteBulk\n MESSAGE_DELETE: typeof handlers.handleMessageDelete\n MESSAGE_REACTION_ADD: typeof handlers.handleMessageReactionAdd\n MESSAGE_REACTION_REMOVE_ALL: typeof handlers.handleMessageReactionRemoveAll\n MESSAGE_REACTION_REMOVE_EMOJI: typeof handlers.handleMessageReactionRemoveEmoji\n MESSAGE_REACTION_REMOVE: typeof handlers.handleMessageReactionRemove\n MESSAGE_UPDATE: typeof handlers.handleMessageUpdate\n PRESENCE_UPDATE: typeof handlers.handlePresenceUpdate\n TYPING_START: typeof handlers.handleTypingStart\n USER_UPDATE: typeof handlers.handleUserUpdate\n VOICE_SERVER_UPDATE: typeof handlers.handleVoiceServerUpdate\n VOICE_STATE_UPDATE: typeof handlers.handleVoiceStateUpdate\n WEBHOOKS_UPDATE: typeof handlers.handleWebhooksUpdate\n INTEGRATION_CREATE: typeof handlers.handleIntegrationCreate\n INTEGRATION_UPDATE: typeof handlers.handleIntegrationUpdate\n INTEGRATION_DELETE: typeof handlers.handleIntegrationDelete\n}\n\nexport enum MessageFlags {\n /** Whether this message has been published to subscribed channels (via Channel Following) */\n Crossposted = 1 << 0,\n /** Whether this message originated from a message in another channel (via Channel Following) */\n IsCrosspost = 1 << 1,\n /** Whether do not include any embeds when serializing this message */\n SuppressEmbeds = 1 << 2,\n /** Whether the source message for this crosspost has been deleted (via Channel Following) */\n SourceMessageDeleted = 1 << 3,\n /** Whether this message came from the urgent message system */\n Urgent = 1 << 4,\n /** Whether this message has an associated thread, with the same id as the message */\n HasThread = 1 << 5,\n /** Whether this message is only visible to the user who invoked the Interaction */\n Ephemeral = 1 << 6,\n /** Whether this message is an Interaction Response and the bot is \"thinking\" */\n Loading = 1 << 7,\n /** Whether this message failed to mention some roles and add their members to the thread */\n FailedToMentionSomeRolesInThread = 1 << 8,\n /** Whether this message will not trigger push and desktop notifications */\n SuppressNotifications = 1 << 12,\n}\n"],"names":["ApplicationCommandTypes","isContextApplicationCommand","command","type","Message","User","MessageFlags","Crossposted","IsCrosspost","SuppressEmbeds","SourceMessageDeleted","Urgent","HasThread","Ephemeral","Loading","FailedToMentionSomeRolesInThread","SuppressNotifications"],"mappings":"AAAA,SACEA,uBAAuB,QAqBlB,oBAAmB;AAK1B,OAAO,SAASC,4BAA4BC,OAAiC,EAA8C;IACzH,OAAOA,QAAQC,IAAI,KAAKH,wBAAwBI,OAAO,IAAIF,QAAQC,IAAI,KAAKH,wBAAwBK,IAAI;AAC1G,CAAC;WAmLM;UAAKC,YAAY;IAAZA,aAAAA,aACV,2FAA2F,GAC3FC,iBAAAA,KAAAA;IAFUD,aAAAA,aAGV,8FAA8F,GAC9FE,iBAAAA,KAAAA;IAJUF,aAAAA,aAKV,oEAAoE,GACpEG,oBAAAA,KAAAA;IANUH,aAAAA,aAOV,2FAA2F,GAC3FI,0BAAAA,KAAAA;IARUJ,aAAAA,aASV,6DAA6D,GAC7DK,YAAAA,MAAAA;IAVUL,aAAAA,aAWV,mFAAmF,GACnFM,eAAAA,MAAAA;IAZUN,aAAAA,aAaV,iFAAiF,GACjFO,eAAAA,MAAAA;IAdUP,aAAAA,aAeV,8EAA8E,GAC9EQ,aAAAA,OAAAA;IAhBUR,aAAAA,aAiBV,0FAA0F,GAC1FS,sCAAAA,OAAAA;IAlBUT,aAAAA,aAmBV,yEAAyE,GACzEU,2BAAAA,QAAAA;GApBUV,iBAAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@discordeno/bot",
3
- "version": "19.0.0-next.5c42bdd",
3
+ "version": "19.0.0-next.5edfbb7",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -24,10 +24,10 @@
24
24
  "test:test-type": "tsc --project tsconfig.test.json"
25
25
  },
26
26
  "dependencies": {
27
- "@discordeno/gateway": "19.0.0-next.5c42bdd",
28
- "@discordeno/rest": "19.0.0-next.5c42bdd",
29
- "@discordeno/types": "19.0.0-next.5c42bdd",
30
- "@discordeno/utils": "19.0.0-next.5c42bdd"
27
+ "@discordeno/gateway": "19.0.0-next.5edfbb7",
28
+ "@discordeno/rest": "19.0.0-next.5edfbb7",
29
+ "@discordeno/types": "19.0.0-next.5edfbb7",
30
+ "@discordeno/utils": "19.0.0-next.5edfbb7"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@swc/cli": "^0.1.62",