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:
Ryan Munro
2024-09-24 00:13:14 +10:00
committed by GitHub
parent cda8d88ad5
commit 6c77fee41b
3 changed files with 17 additions and 17 deletions

View File

@@ -107,6 +107,21 @@ class BaseInteraction extends Base {
(coll, entitlement) => coll.set(entitlement.id, this.client.application.entitlements._add(entitlement)),
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;
}
/**

View File

@@ -45,21 +45,6 @@ class CommandInteraction extends BaseInteraction {
*/
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
* @type {boolean}

View File

@@ -547,7 +547,6 @@ export type GuildCacheMessage<Cached extends CacheType> = CacheTypeReducer<
export type BooleanCache<Cached extends CacheType> = Cached extends 'cached' ? true : false;
export abstract class CommandInteraction<Cached extends CacheType = CacheType> extends BaseInteraction<Cached> {
public authorizingIntegrationOwners: APIAuthorizingIntegrationOwnersMap;
public type: InteractionType.ApplicationCommand;
public get command(): ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
public options: Omit<
@@ -572,7 +571,6 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
public commandName: string;
public commandType: ApplicationCommandType;
public commandGuildId: Snowflake | null;
public context: InteractionContextType | null;
public deferred: boolean;
public ephemeral: boolean | null;
public replied: boolean;
@@ -1925,6 +1923,7 @@ export class BaseInteraction<Cached extends CacheType = CacheType> extends Base
private readonly _cacheType: Cached;
protected constructor(client: Client<true>, data: RawInteractionData);
public applicationId: Snowflake;
public authorizingIntegrationOwners: APIAuthorizingIntegrationOwnersMap;
public get channel(): CacheTypeReducer<
Cached,
GuildTextBasedChannel | null,
@@ -1933,6 +1932,7 @@ export class BaseInteraction<Cached extends CacheType = CacheType> extends Base
TextBasedChannel | null
>;
public channelId: Snowflake | null;
public context: InteractionContextType | null;
public get createdAt(): Date;
public get createdTimestamp(): number;
public get guild(): CacheTypeReducer<Cached, Guild, null>;