mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
fix(BaseInteraction): add missing props (#10517)
* fix(AutocompleteInteraction): add missing authorizingIntegrationOwners * fix(AutocompleteInteraction): add missing context * fix(AutocompleteInteraction): types * fix: move to BaseInteraction * fix: remove props from CommandInteraction * Update packages/discord.js/typings/index.d.ts Co-authored-by: Danial Raza <danialrazafb@gmail.com> --------- Co-authored-by: Vlad Frangu <me@vladfrangu.dev> Co-authored-by: Danial Raza <danialrazafb@gmail.com>
This commit is contained in:
@@ -107,6 +107,21 @@ class BaseInteraction extends Base {
|
|||||||
(coll, entitlement) => coll.set(entitlement.id, this.client.application.entitlements._add(entitlement)),
|
(coll, entitlement) => coll.set(entitlement.id, this.client.application.entitlements._add(entitlement)),
|
||||||
new Collection(),
|
new Collection(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* eslint-disable max-len */
|
||||||
|
/**
|
||||||
|
* Mapping of installation contexts that the interaction was authorized for the related user or guild ids
|
||||||
|
* @type {APIAuthorizingIntegrationOwnersMap}
|
||||||
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object}
|
||||||
|
*/
|
||||||
|
this.authorizingIntegrationOwners = data.authorizing_integration_owners;
|
||||||
|
/* eslint-enable max-len */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context where the interaction was triggered from
|
||||||
|
* @type {?InteractionContextType}
|
||||||
|
*/
|
||||||
|
this.context = data.context ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -45,21 +45,6 @@ class CommandInteraction extends BaseInteraction {
|
|||||||
*/
|
*/
|
||||||
this.commandGuildId = data.data.guild_id ?? null;
|
this.commandGuildId = data.data.guild_id ?? null;
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
|
||||||
/**
|
|
||||||
* Mapping of installation contexts that the interaction was authorized for the related user or guild ids
|
|
||||||
* @type {APIAuthorizingIntegrationOwnersMap}
|
|
||||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object}
|
|
||||||
*/
|
|
||||||
this.authorizingIntegrationOwners = data.authorizing_integration_owners;
|
|
||||||
/* eslint-enable max-len */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Context where the interaction was triggered from
|
|
||||||
* @type {?InteractionContextType}
|
|
||||||
*/
|
|
||||||
this.context = data.context ?? null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the reply to this interaction has been deferred
|
* Whether the reply to this interaction has been deferred
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
|||||||
4
packages/discord.js/typings/index.d.ts
vendored
4
packages/discord.js/typings/index.d.ts
vendored
@@ -547,7 +547,6 @@ export type GuildCacheMessage<Cached extends CacheType> = CacheTypeReducer<
|
|||||||
export type BooleanCache<Cached extends CacheType> = Cached extends 'cached' ? true : false;
|
export type BooleanCache<Cached extends CacheType> = Cached extends 'cached' ? true : false;
|
||||||
|
|
||||||
export abstract class CommandInteraction<Cached extends CacheType = CacheType> extends BaseInteraction<Cached> {
|
export abstract class CommandInteraction<Cached extends CacheType = CacheType> extends BaseInteraction<Cached> {
|
||||||
public authorizingIntegrationOwners: APIAuthorizingIntegrationOwnersMap;
|
|
||||||
public type: InteractionType.ApplicationCommand;
|
public type: InteractionType.ApplicationCommand;
|
||||||
public get command(): ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
|
public get command(): ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
|
||||||
public options: Omit<
|
public options: Omit<
|
||||||
@@ -572,7 +571,6 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
|
|||||||
public commandName: string;
|
public commandName: string;
|
||||||
public commandType: ApplicationCommandType;
|
public commandType: ApplicationCommandType;
|
||||||
public commandGuildId: Snowflake | null;
|
public commandGuildId: Snowflake | null;
|
||||||
public context: InteractionContextType | null;
|
|
||||||
public deferred: boolean;
|
public deferred: boolean;
|
||||||
public ephemeral: boolean | null;
|
public ephemeral: boolean | null;
|
||||||
public replied: boolean;
|
public replied: boolean;
|
||||||
@@ -1925,6 +1923,7 @@ export class BaseInteraction<Cached extends CacheType = CacheType> extends Base
|
|||||||
private readonly _cacheType: Cached;
|
private readonly _cacheType: Cached;
|
||||||
protected constructor(client: Client<true>, data: RawInteractionData);
|
protected constructor(client: Client<true>, data: RawInteractionData);
|
||||||
public applicationId: Snowflake;
|
public applicationId: Snowflake;
|
||||||
|
public authorizingIntegrationOwners: APIAuthorizingIntegrationOwnersMap;
|
||||||
public get channel(): CacheTypeReducer<
|
public get channel(): CacheTypeReducer<
|
||||||
Cached,
|
Cached,
|
||||||
GuildTextBasedChannel | null,
|
GuildTextBasedChannel | null,
|
||||||
@@ -1933,6 +1932,7 @@ export class BaseInteraction<Cached extends CacheType = CacheType> extends Base
|
|||||||
TextBasedChannel | null
|
TextBasedChannel | null
|
||||||
>;
|
>;
|
||||||
public channelId: Snowflake | null;
|
public channelId: Snowflake | null;
|
||||||
|
public context: InteractionContextType | null;
|
||||||
public get createdAt(): Date;
|
public get createdAt(): Date;
|
||||||
public get createdTimestamp(): number;
|
public get createdTimestamp(): number;
|
||||||
public get guild(): CacheTypeReducer<Cached, Guild, null>;
|
public get guild(): CacheTypeReducer<Cached, Guild, null>;
|
||||||
|
|||||||
Reference in New Issue
Block a user