feat: add UserContextMenuInteraction and MessageContextMenuInteraction (#7003)

Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: GrapeColor <grapecolor@users.noreply.github.com>
This commit is contained in:
GrapeColor
2021-12-01 20:31:37 +09:00
committed by GitHub
parent a39d8c4d9d
commit 4fe063f0d0
6 changed files with 90 additions and 3 deletions

17
typings/index.d.ts vendored
View File

@@ -1227,6 +1227,8 @@ export class Interaction<Cached extends CacheType = CacheType> extends Base {
public isCommand(): this is CommandInteraction<Cached>;
public isAutocomplete(): this is AutocompleteInteraction<Cached>;
public isContextMenu(): this is ContextMenuInteraction<Cached>;
public isUserContextMenu(): this is UserContextMenuInteraction<Cached>;
public isMessageContextMenu(): this is MessageContextMenuInteraction<Cached>;
public isMessageComponent(): this is MessageComponentInteraction<Cached>;
public isSelectMenu(): this is SelectMenuInteraction<Cached>;
}
@@ -1536,6 +1538,13 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
public static resolveType(type: MessageComponentTypeResolvable): MessageComponentType;
}
export class MessageContextMenuInteraction<Cached extends CacheType = CacheType> extends ContextMenuInteraction<Cached> {
public readonly targetMessage: CacheTypeReducer<Cached, Message, APIMessage>;
public inGuild(): this is MessageContextMenuInteraction<'present'>;
public inCachedGuild(): this is MessageContextMenuInteraction<'cached'>;
public inRawGuild(): this is MessageContextMenuInteraction<'raw'>;
}
export class MessageEmbed {
private _fieldEquals(field: EmbedField, other: EmbedField): boolean;
@@ -2188,6 +2197,14 @@ export class User extends PartialTextBasedChannel(Base) {
public toString(): UserMention;
}
export class UserContextMenuInteraction<Cached extends CacheType = CacheType> extends ContextMenuInteraction<Cached> {
public readonly targetUser: User;
public readonly targetMember: CacheTypeReducer<Cached, GuildMember, APIInteractionGuildMember>;
public inGuild(): this is UserContextMenuInteraction<'present'>;
public inCachedGuild(): this is UserContextMenuInteraction<'cached'>;
public inRawGuild(): this is UserContextMenuInteraction<'raw'>;
}
export class UserFlags extends BitField<UserFlagsString> {
public static FLAGS: Record<UserFlagsString, number>;
public static resolve(bit?: BitFieldResolvable<UserFlagsString, number>): number;