refactor: change xID to xId (#6036)

* refactor: change `xID` to `xId`

* Update src/managers/MessageManager.js

Co-authored-by: Noel <buechler.noel@outlook.com>

Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
Antonio Román
2021-07-04 20:54:27 +02:00
committed by GitHub
parent 281072be44
commit a7c6678c72
95 changed files with 963 additions and 963 deletions

216
typings/index.d.ts vendored
View File

@@ -214,7 +214,7 @@ declare module 'discord.js' {
export class Activity {
constructor(presence: Presence, data?: unknown);
public applicationID: Snowflake | null;
public applicationId: Snowflake | null;
public assets: RichPresenceAssets | null;
public buttons: string[];
public readonly createdAt: Date;
@@ -229,9 +229,9 @@ declare module 'discord.js' {
size: [number, number];
} | null;
public platform: ActivityPlatform | null;
public sessionID: string | null;
public sessionId: string | null;
public state: string | null;
public syncID: string | null;
public syncId: string | null;
public timestamps: {
start: Date | null;
end: Date | null;
@@ -298,13 +298,13 @@ declare module 'discord.js' {
}
export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
constructor(client: Client, data: unknown, guild?: Guild, guildID?: Snowflake);
constructor(client: Client, data: unknown, guild?: Guild, guildId?: Snowflake);
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public defaultPermission: boolean;
public description: string;
public guild: Guild | null;
public guildID: Snowflake | null;
public guildId: Snowflake | null;
public readonly manager: ApplicationCommandManager;
public id: Snowflake;
public name: string;
@@ -520,10 +520,10 @@ declare module 'discord.js' {
public edit(data: ClientUserEditData): Promise<this>;
public setActivity(options?: ActivityOptions): Presence;
public setActivity(name: string, options?: ActivityOptions): Presence;
public setAFK(afk: boolean, shardID?: number | number[]): Presence;
public setAFK(afk: boolean, shardId?: number | number[]): Presence;
public setAvatar(avatar: BufferResolvable | Base64Resolvable): Promise<this>;
public setPresence(data: PresenceData): Presence;
public setStatus(status: PresenceStatusData, shardID?: number | number[]): Presence;
public setStatus(status: PresenceStatusData, shardId?: number | number[]): Presence;
public setUsername(username: string): Promise<this>;
}
@@ -573,8 +573,8 @@ declare module 'discord.js' {
export class CommandInteraction extends Interaction {
public readonly command: ApplicationCommand | ApplicationCommand<{ guild: GuildResolvable }> | null;
public readonly channel: TextChannel | DMChannel | NewsChannel | PartialDMChannel | ThreadChannel | null;
public channelID: Snowflake;
public commandID: Snowflake;
public channelId: Snowflake;
public commandId: Snowflake;
public commandName: string;
public deferred: boolean;
public ephemeral: boolean | null;
@@ -622,31 +622,31 @@ declare module 'discord.js' {
CDN: (root: string) => {
Asset: (name: string) => string;
DefaultAvatar: (id: Snowflake | number) => string;
Emoji: (emojiID: Snowflake, format: 'png' | 'gif') => string;
Emoji: (emojiId: Snowflake, format: 'png' | 'gif') => string;
Avatar: (
userID: Snowflake | number,
userId: Snowflake | number,
hash: string,
format: 'default' | AllowedImageFormat,
size: number,
) => string;
Banner: (guildID: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
Banner: (guildId: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
Icon: (
userID: Snowflake | number,
userId: Snowflake | number,
hash: string,
format: 'default' | AllowedImageFormat,
size: number,
) => string;
AppIcon: (userID: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
AppAsset: (userID: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
GDMIcon: (userID: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
Splash: (guildID: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
AppIcon: (userId: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
AppAsset: (userId: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
GDMIcon: (userId: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
Splash: (guildId: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
DiscoverySplash: (
guildID: Snowflake | number,
guildId: Snowflake | number,
hash: string,
format: AllowedImageFormat,
size: number,
) => string;
TeamIcon: (teamID: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
TeamIcon: (teamId: Snowflake | number, hash: string, format: AllowedImageFormat, size: number) => string;
};
};
WSCodes: {
@@ -869,9 +869,9 @@ declare module 'discord.js' {
private _sortedChannels(channel: Channel): Collection<Snowflake, GuildChannel>;
public readonly afkChannel: VoiceChannel | null;
public afkChannelID: Snowflake | null;
public afkChannelId: Snowflake | null;
public afkTimeout: number;
public applicationID: Snowflake | null;
public applicationId: Snowflake | null;
public approximateMemberCount: number | null;
public approximatePresenceCount: number | null;
public available: boolean;
@@ -892,27 +892,27 @@ declare module 'discord.js' {
public memberCount: number;
public members: GuildMemberManager;
public mfaLevel: MFALevel;
public ownerID: Snowflake;
public ownerId: Snowflake;
public preferredLocale: string;
public premiumSubscriptionCount: number | null;
public premiumTier: PremiumTier;
public presences: PresenceManager;
public readonly publicUpdatesChannel: TextChannel | null;
public publicUpdatesChannelID: Snowflake | null;
public publicUpdatesChannelId: Snowflake | null;
public roles: RoleManager;
public readonly rulesChannel: TextChannel | null;
public rulesChannelID: Snowflake | null;
public rulesChannelId: Snowflake | null;
public readonly shard: WebSocketShard;
public shardID: number;
public shardId: number;
public stageInstances: StageInstanceManager;
public readonly systemChannel: TextChannel | null;
public systemChannelFlags: Readonly<SystemChannelFlags>;
public systemChannelID: Snowflake | null;
public systemChannelId: Snowflake | null;
public vanityURLUses: number | null;
public readonly voiceAdapterCreator: DiscordGatewayAdapterCreator;
public readonly voiceStates: VoiceStateManager;
public readonly widgetChannel: TextChannel | null;
public widgetChannelID: Snowflake | null;
public widgetChannelId: Snowflake | null;
public widgetEnabled: boolean | null;
public addMember(user: UserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
public createIntegration(data: IntegrationData, reason?: string): Promise<Guild>;
@@ -1027,7 +1027,7 @@ declare module 'discord.js' {
public readonly members: Collection<Snowflake, GuildMember>;
public name: string;
public readonly parent: CategoryChannel | null;
public parentID: Snowflake | null;
public parentId: Snowflake | null;
public permissionOverwrites: PermissionOverwriteManager;
public readonly permissionsLocked: boolean | null;
public readonly position: number;
@@ -1078,7 +1078,7 @@ declare module 'discord.js' {
public readonly joinedAt: Date | null;
public joinedTimestamp: number | null;
public readonly kickable: boolean;
public lastMessageChannelID: Snowflake | null;
public lastMessageChannelId: Snowflake | null;
public readonly manageable: boolean;
public nickname: string | null;
public readonly partial: false;
@@ -1132,11 +1132,11 @@ declare module 'discord.js' {
public description: string | null;
public usageCount: number;
public creator: User;
public creatorID: Snowflake;
public creatorId: Snowflake;
public createdAt: Date;
public updatedAt: Date;
public guild: Guild | null;
public guildID: Snowflake;
public guildId: Snowflake;
public serializedGuild: unknown;
public unSynced: boolean | null;
public createGuild(name: string, icon?: BufferResolvable | Base64Resolvable): Promise<Guild>;
@@ -1210,13 +1210,13 @@ declare module 'discord.js' {
export class Interaction extends Base {
constructor(client: Client, data: unknown);
public applicationID: Snowflake;
public applicationId: Snowflake;
public readonly channel: Channel | null;
public channelID: Snowflake | null;
public channelId: Snowflake | null;
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public readonly guild: Guild | null;
public guildID: Snowflake | null;
public guildId: Snowflake | null;
public id: Snowflake;
public member: GuildMember | APIInteractionGuildMember | null;
public readonly token: string;
@@ -1293,9 +1293,9 @@ declare module 'discord.js' {
}
export class InviteStageInstance extends Base {
constructor(client: Client, data: unknown, channelID: Snowflake, guildID: Snowflake);
public channelID: Snowflake;
public guildID: Snowflake;
constructor(client: Client, data: unknown, channelId: Snowflake, guildId: Snowflake);
public channelId: Snowflake;
public guildId: Snowflake;
public members: Collection<Snowflake, GuildMember>;
public topic: string;
public participantCount: number;
@@ -1314,7 +1314,7 @@ declare module 'discord.js' {
private patch(data: unknown): Message;
public activity: MessageActivity | null;
public applicationID: Snowflake | null;
public applicationId: Snowflake | null;
public attachments: Collection<Snowflake, MessageAttachment>;
public author: User;
public channel: TextChannel | DMChannel | NewsChannel | ThreadChannel;
@@ -1347,7 +1347,7 @@ declare module 'discord.js' {
public tts: boolean;
public type: MessageType;
public readonly url: string;
public webhookID: Snowflake | null;
public webhookId: Snowflake | null;
public flags: Readonly<MessageFlags>;
public reference: MessageReference | null;
public awaitMessageComponent<T extends MessageComponentInteraction = MessageComponentInteraction>(
@@ -1415,14 +1415,14 @@ declare module 'discord.js' {
export class MessageButton extends BaseMessageComponent {
constructor(data?: MessageButton | MessageButtonOptions);
public customID: string | null;
public customId: string | null;
public disabled: boolean;
public emoji: APIPartialEmoji | null;
public label: string | null;
public style: MessageButtonStyle | null;
public type: 'BUTTON';
public url: string | null;
public setCustomID(customID: string): this;
public setCustomId(customId: string): this;
public setDisabled(disabled: boolean): this;
public setEmoji(emoji: EmojiIdentifierResolvable): this;
public setLabel(label: string): this;
@@ -1450,7 +1450,7 @@ declare module 'discord.js' {
public readonly channel: TextChannel | DMChannel | NewsChannel | PartialDMChannel | ThreadChannel | null;
public readonly component: MessageActionRowComponent | Exclude<APIMessageComponent, APIActionRowComponent> | null;
public componentType: MessageComponentType;
public customID: string;
public customId: string;
public deferred: boolean;
public ephemeral: boolean | null;
public message: Message | APIMessage;
@@ -1562,7 +1562,7 @@ declare module 'discord.js' {
class MessageSelectMenu extends BaseMessageComponent {
constructor(data?: MessageSelectMenu | MessageSelectMenuOptions);
public customID: string | null;
public customId: string | null;
public disabled: boolean;
public maxValues: number | null;
public minValues: number | null;
@@ -1570,7 +1570,7 @@ declare module 'discord.js' {
public placeholder: string | null;
public type: 'SELECT_MENU';
public addOptions(...options: MessageSelectOptionData[] | MessageSelectOptionData[][]): this;
public setCustomID(customID: string): this;
public setCustomId(customId: string): this;
public setDisabled(disabled: boolean): this;
public setMaxValues(maxValues: number): this;
public setMinValues(minValues: number): this;
@@ -1653,7 +1653,7 @@ declare module 'discord.js' {
public readonly member: GuildMember | null;
public status: PresenceStatus;
public readonly user: User | null;
public userID: Snowflake;
public userId: Snowflake;
public equals(presence: Presence): boolean;
}
@@ -1813,7 +1813,7 @@ declare module 'discord.js' {
public send(message: any): Promise<void>;
public static singleton(client: Client, mode: ShardingManagerMode): ShardClientUtil;
public static shardIDForGuildID(guildID: Snowflake, shardCount: number): number;
public static shardIdForGuildId(guildId: Snowflake, shardCount: number): number;
}
export class ShardingManager extends EventEmitter {
@@ -1868,8 +1868,8 @@ declare module 'discord.js' {
constructor(client: Client, data: unknown, channel: StageChannel);
public id: Snowflake;
public deleted: boolean;
public guildID: Snowflake;
public channelID: Snowflake;
public guildId: Snowflake;
public channelId: Snowflake;
public topic: string;
public privacyLevel: PrivacyLevel;
public discoverableDisabled: boolean;
@@ -1898,7 +1898,7 @@ declare module 'discord.js' {
public id: Snowflake;
public name: string;
public icon: string | null;
public ownerID: Snowflake | null;
public ownerId: Snowflake | null;
public members: Collection<Snowflake, TeamMember>;
public readonly owner: TeamMember;
@@ -1960,9 +1960,9 @@ declare module 'discord.js' {
public messages: MessageManager;
public members: ThreadMemberManager;
public name: string;
public ownerID: Snowflake;
public ownerId: Snowflake;
public readonly parent: TextChannel | NewsChannel | null;
public parentID: Snowflake;
public parentId: Snowflake;
public rateLimitPerUser: number;
public type: ThreadChannelType;
public readonly unarchivable: boolean;
@@ -2011,7 +2011,7 @@ declare module 'discord.js' {
public readonly dmChannel: DMChannel | null;
public flags: Readonly<UserFlags> | null;
public id: Snowflake;
public lastMessageID: Snowflake | null;
public lastMessageId: Snowflake | null;
public readonly partial: false;
public readonly presence: Presence;
public system: boolean;
@@ -2038,7 +2038,7 @@ declare module 'discord.js' {
export class Util extends null {
private constructor();
public static basename(path: string, ext?: string): string;
public static binaryToID(num: string): Snowflake;
public static binaryToId(num: string): Snowflake;
public static cleanContent(str: string, channel: Channel): string;
public static removeMentions(str: string): string;
public static cloneObject(obj: unknown): unknown;
@@ -2115,7 +2115,7 @@ declare module 'discord.js' {
export class VoiceState extends Base {
constructor(guild: Guild, data: unknown);
public readonly channel: VoiceChannel | StageChannel | null;
public channelID: Snowflake | null;
public channelId: Snowflake | null;
public readonly deaf: boolean | null;
public guild: Guild;
public id: Snowflake;
@@ -2125,7 +2125,7 @@ declare module 'discord.js' {
public selfMute: boolean | null;
public serverDeaf: boolean | null;
public serverMute: boolean | null;
public sessionID: string | null;
public sessionId: string | null;
public streaming: boolean;
public selfVideo: boolean | null;
public suppress: boolean;
@@ -2158,9 +2158,9 @@ declare module 'discord.js' {
constructor(client: Client, data?: unknown);
public avatar: string;
public avatarURL(options?: StaticImageURLOptions): string | null;
public channelID: Snowflake;
public channelId: Snowflake;
public client: Client;
public guildID: Snowflake;
public guildId: Snowflake;
public name: string;
public owner: User | unknown | null;
public sourceGuild: Guild | unknown | null;
@@ -2196,8 +2196,8 @@ declare module 'discord.js' {
public status: Status;
public readonly ping: number;
public on(event: WSEventType, listener: (data: any, shardID: number) => void): this;
public once(event: WSEventType, listener: (data: any, shardID: number) => void): this;
public on(event: WSEventType, listener: (data: any, shardId: number) => void): this;
public once(event: WSEventType, listener: (data: any, shardId: number) => void): this;
private debug(message: string, shard?: WebSocketShard): void;
private connect(): Promise<void>;
@@ -2214,7 +2214,7 @@ declare module 'discord.js' {
constructor(manager: WebSocketManager, id: number);
private sequence: number;
private closeSequence: number;
private sessionID: string | null;
private sessionId: string | null;
private lastPingTimestamp: number;
private lastHeartbeatAcked: boolean;
private ratelimit: { queue: unknown[]; total: number; remaining: number; time: 60e3; timer: NodeJS.Timeout | null };
@@ -2286,14 +2286,14 @@ declare module 'discord.js' {
public selfDeaf?: boolean;
public selfMute?: boolean;
public suppress?: boolean;
public channelID?: Snowflake;
public channelId?: Snowflake;
public avatarURL: string;
public activity?: WidgetActivity;
}
export class WelcomeChannel extends Base {
private _emoji: unknown;
public channelID: Snowflake;
public channelId: Snowflake;
public guild: Guild | InviteGuild;
public description: string;
public readonly channel: TextChannel | NewsChannel | null;
@@ -2343,8 +2343,8 @@ declare module 'discord.js' {
public readonly cache: Collection<K, Holds>;
public resolve(resolvable: Holds): Holds;
public resolve(resolvable: R): Holds | null;
public resolveID(resolvable: Holds): K;
public resolveID(resolvable: R): K | null;
public resolveId(resolvable: Holds): K;
public resolveId(resolvable: R): K | null;
public valueOf(): Collection<K, Holds>;
}
@@ -2366,23 +2366,23 @@ declare module 'discord.js' {
PermissionsGuildType,
null
>;
private commandPath({ id, guildID }: { id?: Snowflake; guildID?: Snowflake }): unknown;
public create(command: ApplicationCommandData, guildID: Snowflake): Promise<ApplicationCommand>;
public create(command: ApplicationCommandData, guildID?: Snowflake): Promise<ApplicationCommandType>;
public delete(command: ApplicationCommandResolvable, guildID?: Snowflake): Promise<ApplicationCommandType | null>;
private commandPath({ id, guildId }: { id?: Snowflake; guildId?: Snowflake }): unknown;
public create(command: ApplicationCommandData, guildId: Snowflake): Promise<ApplicationCommand>;
public create(command: ApplicationCommandData, guildId?: Snowflake): Promise<ApplicationCommandType>;
public delete(command: ApplicationCommandResolvable, guildId?: Snowflake): Promise<ApplicationCommandType | null>;
public edit(
command: ApplicationCommandResolvable,
data: ApplicationCommandData,
guildID: Snowflake,
guildId: Snowflake,
): Promise<ApplicationCommand>;
public edit(
command: ApplicationCommandResolvable,
data: ApplicationCommandData,
guildID?: Snowflake,
guildId?: Snowflake,
): Promise<ApplicationCommandType>;
public fetch(
id: Snowflake,
options: FetchApplicationCommandOptions & { guildID: Snowflake },
options: FetchApplicationCommandOptions & { guildId: Snowflake },
): Promise<ApplicationCommand>;
public fetch(id: Snowflake, options?: FetchApplicationCommandOptions): Promise<ApplicationCommandType>;
public fetch(
@@ -2391,11 +2391,11 @@ declare module 'discord.js' {
): Promise<Collection<Snowflake, ApplicationCommandType>>;
public set(
commands: ApplicationCommandData[],
guildID?: Snowflake,
guildId?: Snowflake,
): Promise<Collection<Snowflake, ApplicationCommand>>;
public set(
commands: ApplicationCommandData[],
guildID?: Snowflake,
guildId?: Snowflake,
): Promise<Collection<Snowflake, ApplicationCommandType>>;
private static transformCommand(command: ApplicationCommandData): unknown;
}
@@ -2405,18 +2405,18 @@ declare module 'discord.js' {
FetchSingleOptions,
FullPermissionsOptions,
GuildType,
CommandIDType,
CommandIdType,
> extends BaseManager {
constructor(manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand);
public client: Client;
public commandID: CommandIDType;
public commandId: CommandIdType;
public guild: GuildType;
public guildID: Snowflake | null;
public guildId: Snowflake | null;
public manager: ApplicationCommandManager | GuildApplicationCommandManager | ApplicationCommand;
public add(
options: FetchSingleOptions & { permissions: ApplicationCommandPermissionData[] },
): Promise<ApplicationCommandPermissions[]>;
public has(options: FetchSingleOptions & { permissionsID: UserResolvable | RoleResolvable }): Promise<boolean>;
public has(options: FetchSingleOptions & { permissionsId: UserResolvable | RoleResolvable }): Promise<boolean>;
public fetch(options: FetchSingleOptions): Promise<ApplicationCommandPermissions[]>;
public fetch(options: BaseOptions): Promise<Collection<Snowflake, ApplicationCommandPermissions[]>>;
public remove(
@@ -2438,7 +2438,7 @@ declare module 'discord.js' {
fullPermissions: GuildApplicationCommandPermissionData[];
},
): Promise<Collection<Snowflake, ApplicationCommandPermissions[]>>;
private permissionsPath(guildID: Snowflake, commandID?: Snowflake): unknown;
private permissionsPath(guildId: Snowflake, commandId?: Snowflake): unknown;
private static transformPermissions(permissions: ApplicationCommandPermissionData, received?: boolean): unknown;
}
@@ -2708,7 +2708,7 @@ declare module 'discord.js' {
): Constructable<T & Omit<TextBasedChannelFields, I>>;
interface PartialTextBasedChannelFields {
lastMessageID: Snowflake | null;
lastMessageId: Snowflake | null;
readonly lastMessage: Message | null;
send(options: string | MessagePayload | MessageOptions): Promise<Message>;
}
@@ -2766,13 +2766,13 @@ declare module 'discord.js' {
type ActivityFlagsString = 'INSTANCE' | 'JOIN' | 'SPECTATE' | 'JOIN_REQUEST' | 'SYNC' | 'PLAY';
type ActivitiesOptions = Omit<ActivityOptions, 'shardID'>;
type ActivitiesOptions = Omit<ActivityOptions, 'shardId'>;
interface ActivityOptions {
name?: string;
url?: string;
type?: ActivityType | number;
shardID?: number | readonly number[];
shardId?: number | readonly number[];
}
type ActivityPlatform = 'desktop' | 'samsung' | 'xbox';
@@ -3030,7 +3030,7 @@ declare module 'discord.js' {
nsfw?: boolean;
bitrate?: number;
userLimit?: number;
parentID?: Snowflake | null;
parentId?: Snowflake | null;
rateLimitPerUser?: number;
lockPermissions?: boolean;
permissionOverwrites?: readonly OverwriteResolvable[] | Collection<Snowflake, OverwriteResolvable>;
@@ -3128,11 +3128,11 @@ declare module 'discord.js' {
/** @deprecated Use interactionCreate instead */
interaction: [interaction: Interaction];
interactionCreate: [interaction: Interaction];
shardDisconnect: [closeEvent: CloseEvent, shardID: number];
shardError: [error: Error, shardID: number];
shardReady: [shardID: number, unavailableGuilds: Set<Snowflake> | undefined];
shardReconnecting: [shardID: number];
shardResume: [shardID: number, replayedEvents: number];
shardDisconnect: [closeEvent: CloseEvent, shardId: number];
shardError: [error: Error, shardId: number];
shardReady: [shardId: number, unavailableGuilds: Set<Snowflake> | undefined];
shardReconnecting: [shardId: number];
shardResume: [shardId: number, replayedEvents: number];
stageInstanceCreate: [stageInstance: StageInstance];
stageInstanceUpdate: [oldStageInstance: StageInstance | null, newStageInstance: StageInstance];
stageInstanceDelete: [stageInstance: StageInstance];
@@ -3251,8 +3251,8 @@ declare module 'discord.js' {
}
interface CrosspostedChannel {
channelID: Snowflake;
guildID: Snowflake;
channelId: Snowflake;
guildId: Snowflake;
type: keyof typeof ChannelType;
name: string;
}
@@ -3262,8 +3262,8 @@ declare module 'discord.js' {
interface DeconstructedSnowflake {
timestamp: number;
readonly date: Date;
workerID: number;
processID: number;
workerId: number;
processId: number;
increment: number;
binary: string;
}
@@ -3313,7 +3313,7 @@ declare module 'discord.js' {
type ExplicitContentFilterLevel = keyof typeof ExplicitContentFilterLevels;
interface FetchApplicationCommandOptions extends BaseFetchOptions {
guildID?: Snowflake;
guildId?: Snowflake;
}
interface FetchBanOptions extends BaseFetchOptions {
@@ -3496,7 +3496,7 @@ declare module 'discord.js' {
}
interface GuildCreateOptions {
afkChannelID?: Snowflake | number;
afkChannelId?: Snowflake | number;
afkTimeout?: number;
channels?: PartialChannelData[];
defaultMessageNotifications?: DefaultMessageNotificationLevel | number;
@@ -3504,7 +3504,7 @@ declare module 'discord.js' {
icon?: BufferResolvable | Base64Resolvable | null;
roles?: PartialRoleData[];
systemChannelFlags?: SystemChannelFlagsResolvable;
systemChannelID?: Snowflake | number;
systemChannelId?: Snowflake | number;
verificationLevel?: VerificationLevel | number;
}
@@ -3745,14 +3745,14 @@ declare module 'discord.js' {
}
interface MessageActivity {
partyID: string;
partyId: string;
type: number;
}
type MessageAdditions = MessageEmbed | MessageAttachment | (MessageEmbed | MessageAttachment)[];
interface MessageButtonOptions extends BaseMessageComponentOptions {
customID?: string;
customId?: string;
disabled?: boolean;
emoji?: EmojiIdentifierResolvable;
label?: string;
@@ -3905,15 +3905,15 @@ declare module 'discord.js' {
| string;
interface MessageReference {
channelID: Snowflake;
guildID: Snowflake;
messageID: Snowflake | null;
channelId: Snowflake;
guildId: Snowflake;
messageId: Snowflake | null;
}
type MessageResolvable = Message | Snowflake;
interface MessageSelectMenuOptions extends BaseMessageComponentOptions {
customID?: string;
customId?: string;
disabled?: boolean;
maxValues?: number;
minValues?: number;
@@ -4060,7 +4060,7 @@ declare module 'discord.js' {
status?: PresenceStatusData;
afk?: boolean;
activities?: ActivitiesOptions[];
shardID?: number | number[];
shardId?: number | number[];
}
type PresenceResolvable = Presence | UserResolvable | Snowflake;
@@ -4083,10 +4083,10 @@ declare module 'discord.js' {
interface PartialDMChannel
extends Partialize<
DMChannel,
'lastMessage' | 'lastMessageID' | 'messages' | 'recipient' | 'type' | 'typing' | 'typingCount'
'lastMessage' | 'lastMessageId' | 'messages' | 'recipient' | 'type' | 'typing' | 'typingCount'
> {
lastMessage: null;
lastMessageID: undefined;
lastMessageId: undefined;
messages: MessageManager;
recipient: User | PartialUser;
type: 'dm';
@@ -4099,7 +4099,7 @@ declare module 'discord.js' {
name: string;
topic?: string;
type?: ChannelType;
parentID?: Snowflake | number;
parentId?: Snowflake | number;
permissionOverwrites?: PartialOverwriteData[];
}
@@ -4240,8 +4240,8 @@ declare module 'discord.js' {
type RoleResolvable = Role | Snowflake;
interface RoleTagData {
botID?: Snowflake;
integrationID?: Snowflake;
botId?: Snowflake;
integrationId?: Snowflake;
premiumSubscriberRole?: true;
}
@@ -4299,7 +4299,7 @@ declare module 'discord.js' {
public format: StickerFormatType;
public id: Snowflake;
public name: string;
public packID: Snowflake;
public packId: Snowflake;
public tags: string[];
public readonly url: string;
}
@@ -4399,7 +4399,7 @@ declare module 'discord.js' {
interface WebhookMessageOptions extends Omit<MessageOptions, 'reply'> {
username?: string;
avatarURL?: string;
threadID?: Snowflake;
threadId?: Snowflake;
}
type WebhookType = keyof typeof WebhookTypes;

View File

@@ -2,7 +2,6 @@
import {
Client,
Options,
Collection,
Intents,
Message,
@@ -10,6 +9,7 @@ import {
MessageAttachment,
MessageButton,
MessageEmbed,
Options,
Permissions,
Serialized,
ShardClientUtil,
@@ -23,339 +23,339 @@ const client: Client = new Client({
}),
});
const testGuildID = '222078108977594368'; // DJS
const testUserID = '987654321098765432'; // example ID
const globalCommandID = '123456789012345678'; // example ID
const guildCommandID = '234567890123456789'; // example ID
const testGuildId = '222078108977594368'; // DJS
const testUserId = '987654321098765432'; // example id
const globalCommandId = '123456789012345678'; // example id
const guildCommandId = '234567890123456789'; // example id
client.on('ready', async () => {
console.log(`Client is logged in as ${client.user!.tag} and ready!`);
// Test command manager methods
const globalCommand = await client.application?.commands.fetch(globalCommandID);
const guildCommandFromGlobal = await client.application?.commands.fetch(guildCommandID, { guildID: testGuildID });
const guildCommandFromGuild = await client.guilds.cache.get(testGuildID)?.commands.fetch(guildCommandID);
const globalCommand = await client.application?.commands.fetch(globalCommandId);
const guildCommandFromGlobal = await client.application?.commands.fetch(guildCommandId, { guildId: testGuildId });
const guildCommandFromGuild = await client.guilds.cache.get(testGuildId)?.commands.fetch(guildCommandId);
// @ts-expect-error
await client.guilds.cache.get(testGuildID)?.commands.fetch(guildCommandID, { guildID: testGuildID });
await client.guilds.cache.get(testGuildId)?.commands.fetch(guildCommandId, { guildId: testGuildId });
// Test command permissions
const globalPermissionsManager = client.application?.commands.permissions;
const guildPermissionsManager = client.guilds.cache.get(testGuildID)?.commands.permissions;
const originalPermissions = await client.application?.commands.permissions.fetch({ guild: testGuildID });
const guildPermissionsManager = client.guilds.cache.get(testGuildId)?.commands.permissions;
const originalPermissions = await client.application?.commands.permissions.fetch({ guild: testGuildId });
// Permissions from global manager
await globalPermissionsManager?.add({
command: globalCommandID,
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await globalPermissionsManager?.has({ command: globalCommandID, guild: testGuildID, permissionsID: testGuildID });
await globalPermissionsManager?.fetch({ guild: testGuildID });
await globalPermissionsManager?.fetch({ command: globalCommandID, guild: testGuildID });
await globalPermissionsManager?.remove({ command: globalCommandID, guild: testGuildID, roles: [testGuildID] });
await globalPermissionsManager?.remove({ command: globalCommandID, guild: testGuildID, users: [testUserID] });
await globalPermissionsManager?.has({ command: globalCommandId, guild: testGuildId, permissionsId: testGuildId });
await globalPermissionsManager?.fetch({ guild: testGuildId });
await globalPermissionsManager?.fetch({ command: globalCommandId, guild: testGuildId });
await globalPermissionsManager?.remove({ command: globalCommandId, guild: testGuildId, roles: [testGuildId] });
await globalPermissionsManager?.remove({ command: globalCommandId, guild: testGuildId, users: [testUserId] });
await globalPermissionsManager?.remove({
command: globalCommandID,
guild: testGuildID,
roles: [testGuildID],
users: [testUserID],
command: globalCommandId,
guild: testGuildId,
roles: [testGuildId],
users: [testUserId],
});
await globalPermissionsManager?.set({
command: globalCommandID,
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await globalPermissionsManager?.set({
guild: testGuildID,
fullPermissions: [{ id: globalCommandID, permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] }],
guild: testGuildId,
fullPermissions: [{ id: globalCommandId, permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] }],
});
// @ts-expect-error
await globalPermissionsManager?.add({
command: globalCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await globalPermissionsManager?.has({ command: globalCommandID, permissionsID: testGuildID });
await globalPermissionsManager?.has({ command: globalCommandId, permissionsId: testGuildId });
// @ts-expect-error
await globalPermissionsManager?.fetch();
// @ts-expect-error
await globalPermissionsManager?.fetch({ command: globalCommandID });
await globalPermissionsManager?.fetch({ command: globalCommandId });
// @ts-expect-error
await globalPermissionsManager?.remove({ command: globalCommandID, roles: [testGuildID] });
await globalPermissionsManager?.remove({ command: globalCommandId, roles: [testGuildId] });
// @ts-expect-error
await globalPermissionsManager?.remove({ command: globalCommandID, users: [testUserID] });
await globalPermissionsManager?.remove({ command: globalCommandId, users: [testUserId] });
// @ts-expect-error
await globalPermissionsManager?.remove({ command: globalCommandID, roles: [testGuildID], users: [testUserID] });
await globalPermissionsManager?.remove({ command: globalCommandId, roles: [testGuildId], users: [testUserId] });
// @ts-expect-error
await globalPermissionsManager?.set({
command: globalCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await globalPermissionsManager?.set({
fullPermissions: [{ id: globalCommandID, permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] }],
fullPermissions: [{ id: globalCommandId, permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] }],
});
// @ts-expect-error
await globalPermissionsManager?.set({
command: globalCommandID,
guild: testGuildID,
fullPermissions: [{ id: globalCommandID, permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] }],
command: globalCommandId,
guild: testGuildId,
fullPermissions: [{ id: globalCommandId, permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] }],
});
// @ts-expect-error
await globalPermissionsManager?.add({
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await globalPermissionsManager?.has({ guild: testGuildID, permissionsID: testGuildID });
await globalPermissionsManager?.has({ guild: testGuildId, permissionsId: testGuildId });
// @ts-expect-error
await globalPermissionsManager?.remove({ guild: testGuildID, roles: [testGuildID] });
await globalPermissionsManager?.remove({ guild: testGuildId, roles: [testGuildId] });
// @ts-expect-error
await globalPermissionsManager?.remove({ guild: testGuildID, users: [testUserID] });
await globalPermissionsManager?.remove({ guild: testGuildId, users: [testUserId] });
// @ts-expect-error
await globalPermissionsManager?.remove({ guild: testGuildID, roles: [testGuildID], users: [testUserID] });
await globalPermissionsManager?.remove({ guild: testGuildId, roles: [testGuildId], users: [testUserId] });
// @ts-expect-error
await globalPermissionsManager?.set({
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// Permissions from guild manager
await guildPermissionsManager?.add({
command: globalCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await guildPermissionsManager?.has({ command: globalCommandID, permissionsID: testGuildID });
await guildPermissionsManager?.has({ command: globalCommandId, permissionsId: testGuildId });
await guildPermissionsManager?.fetch({});
await guildPermissionsManager?.fetch({ command: globalCommandID });
await guildPermissionsManager?.remove({ command: globalCommandID, roles: [testGuildID] });
await guildPermissionsManager?.remove({ command: globalCommandID, users: [testUserID] });
await guildPermissionsManager?.remove({ command: globalCommandID, roles: [testGuildID], users: [testUserID] });
await guildPermissionsManager?.fetch({ command: globalCommandId });
await guildPermissionsManager?.remove({ command: globalCommandId, roles: [testGuildId] });
await guildPermissionsManager?.remove({ command: globalCommandId, users: [testUserId] });
await guildPermissionsManager?.remove({ command: globalCommandId, roles: [testGuildId], users: [testUserId] });
await guildPermissionsManager?.set({
command: globalCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await guildPermissionsManager?.set({
fullPermissions: [{ id: globalCommandID, permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] }],
fullPermissions: [{ id: globalCommandId, permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] }],
});
await guildPermissionsManager?.add({
command: globalCommandID,
command: globalCommandId,
// @ts-expect-error
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await guildPermissionsManager?.has({ command: globalCommandID, guild: testGuildID, permissionsID: testGuildID });
await guildPermissionsManager?.has({ command: globalCommandId, guild: testGuildId, permissionsId: testGuildId });
// @ts-expect-error
await guildPermissionsManager?.fetch({ guild: testGuildID });
await guildPermissionsManager?.fetch({ guild: testGuildId });
// @ts-expect-error
await guildPermissionsManager?.fetch({ command: globalCommandID, guild: testGuildID });
await guildPermissionsManager?.fetch({ command: globalCommandId, guild: testGuildId });
// @ts-expect-error
await guildPermissionsManager?.remove({ command: globalCommandID, guild: testGuildID, roles: [testGuildID] });
await guildPermissionsManager?.remove({ command: globalCommandId, guild: testGuildId, roles: [testGuildId] });
// @ts-expect-error
await guildPermissionsManager?.remove({ command: globalCommandID, guild: testGuildID, users: [testUserID] });
await guildPermissionsManager?.remove({ command: globalCommandId, guild: testGuildId, users: [testUserId] });
await guildPermissionsManager?.remove({
command: globalCommandID,
command: globalCommandId,
// @ts-expect-error
guild: testGuildID,
roles: [testGuildID],
users: [testUserID],
guild: testGuildId,
roles: [testGuildId],
users: [testUserId],
});
// @ts-expect-error
await guildPermissionsManager?.set({
command: globalCommandID,
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await guildPermissionsManager?.set({
// @ts-expect-error
guild: testGuildID,
fullPermissions: [{ id: globalCommandID, permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] }],
guild: testGuildId,
fullPermissions: [{ id: globalCommandId, permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] }],
});
// @ts-expect-error
await guildPermissionsManager?.add({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await guildPermissionsManager?.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
// @ts-expect-error
await guildPermissionsManager?.has({ permissionsID: testGuildID });
await guildPermissionsManager?.has({ permissionsId: testGuildId });
// @ts-expect-error
await guildPermissionsManager?.remove({ roles: [testGuildID] });
await guildPermissionsManager?.remove({ roles: [testGuildId] });
// @ts-expect-error
await guildPermissionsManager?.remove({ users: [testUserID] });
await guildPermissionsManager?.remove({ users: [testUserId] });
// @ts-expect-error
await guildPermissionsManager?.remove({ roles: [testGuildID], users: [testUserID] });
await guildPermissionsManager?.remove({ roles: [testGuildId], users: [testUserId] });
// @ts-expect-error
await guildPermissionsManager?.set({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await guildPermissionsManager?.set({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
// @ts-expect-error
await guildPermissionsManager?.set({
command: globalCommandID,
fullPermissions: [{ id: globalCommandID, permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] }],
command: globalCommandId,
fullPermissions: [{ id: globalCommandId, permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] }],
});
// Permissions from cached global ApplicationCommand
await globalCommand?.permissions.add({
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await globalCommand?.permissions.has({ guild: testGuildID, permissionsID: testGuildID });
await globalCommand?.permissions.fetch({ guild: testGuildID });
await globalCommand?.permissions.remove({ guild: testGuildID, roles: [testGuildID] });
await globalCommand?.permissions.remove({ guild: testGuildID, users: [testUserID] });
await globalCommand?.permissions.remove({ guild: testGuildID, roles: [testGuildID], users: [testUserID] });
await globalCommand?.permissions.has({ guild: testGuildId, permissionsId: testGuildId });
await globalCommand?.permissions.fetch({ guild: testGuildId });
await globalCommand?.permissions.remove({ guild: testGuildId, roles: [testGuildId] });
await globalCommand?.permissions.remove({ guild: testGuildId, users: [testUserId] });
await globalCommand?.permissions.remove({ guild: testGuildId, roles: [testGuildId], users: [testUserId] });
await globalCommand?.permissions.set({
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await globalCommand?.permissions.add({
// @ts-expect-error
command: globalCommandID,
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await globalCommand?.permissions.has({ command: globalCommandID, guild: testGuildID, permissionsID: testGuildID });
await globalCommand?.permissions.has({ command: globalCommandId, guild: testGuildId, permissionsId: testGuildId });
// @ts-expect-error
await globalCommand?.permissions.fetch({ command: globalCommandID, guild: testGuildID });
await globalCommand?.permissions.fetch({ command: globalCommandId, guild: testGuildId });
// @ts-expect-error
await globalCommand?.permissions.remove({ command: globalCommandID, guild: testGuildID, roles: [testGuildID] });
await globalCommand?.permissions.remove({ command: globalCommandId, guild: testGuildId, roles: [testGuildId] });
// @ts-expect-error
await globalCommand?.permissions.remove({ command: globalCommandID, guild: testGuildID, users: [testUserID] });
await globalCommand?.permissions.remove({ command: globalCommandId, guild: testGuildId, users: [testUserId] });
await globalCommand?.permissions.remove({
// @ts-expect-error
command: globalCommandID,
guild: testGuildID,
roles: [testGuildID],
users: [testUserID],
command: globalCommandId,
guild: testGuildId,
roles: [testGuildId],
users: [testUserId],
});
await globalCommand?.permissions.set({
// @ts-expect-error
command: globalCommandID,
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await globalCommand?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await globalCommand?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
// @ts-expect-error
await globalCommand?.permissions.has({ permissionsID: testGuildID });
await globalCommand?.permissions.has({ permissionsId: testGuildId });
// @ts-expect-error
await globalCommand?.permissions.fetch({});
// @ts-expect-error
await globalCommand?.permissions.remove({ roles: [testGuildID] });
await globalCommand?.permissions.remove({ roles: [testGuildId] });
// @ts-expect-error
await globalCommand?.permissions.remove({ users: [testUserID] });
await globalCommand?.permissions.remove({ users: [testUserId] });
// @ts-expect-error
await globalCommand?.permissions.remove({ roles: [testGuildID], users: [testUserID] });
await globalCommand?.permissions.remove({ roles: [testGuildId], users: [testUserId] });
// @ts-expect-error
await globalCommand?.permissions.set({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await globalCommand?.permissions.set({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
// Permissions from cached guild ApplicationCommand
await guildCommandFromGlobal?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await guildCommandFromGlobal?.permissions.has({ permissionsID: testGuildID });
await guildCommandFromGlobal?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
await guildCommandFromGlobal?.permissions.has({ permissionsId: testGuildId });
await guildCommandFromGlobal?.permissions.fetch({});
await guildCommandFromGlobal?.permissions.remove({ roles: [testGuildID] });
await guildCommandFromGlobal?.permissions.remove({ users: [testUserID] });
await guildCommandFromGlobal?.permissions.remove({ roles: [testGuildID], users: [testUserID] });
await guildCommandFromGlobal?.permissions.set({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await guildCommandFromGlobal?.permissions.remove({ roles: [testGuildId] });
await guildCommandFromGlobal?.permissions.remove({ users: [testUserId] });
await guildCommandFromGlobal?.permissions.remove({ roles: [testGuildId], users: [testUserId] });
await guildCommandFromGlobal?.permissions.set({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
await guildCommandFromGlobal?.permissions.add({
// @ts-expect-error
command: globalCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await guildCommandFromGlobal?.permissions.has({ command: guildCommandID, permissionsID: testGuildID });
await guildCommandFromGlobal?.permissions.has({ command: guildCommandId, permissionsId: testGuildId });
// @ts-expect-error
await guildCommandFromGlobal?.permissions.remove({ command: guildCommandID, roles: [testGuildID] });
await guildCommandFromGlobal?.permissions.remove({ command: guildCommandId, roles: [testGuildId] });
// @ts-expect-error
await guildCommandFromGlobal?.permissions.remove({ command: guildCommandID, users: [testUserID] });
await guildCommandFromGlobal?.permissions.remove({ command: guildCommandId, users: [testUserId] });
await guildCommandFromGlobal?.permissions.remove({
// @ts-expect-error
command: guildCommandID,
roles: [testGuildID],
users: [testUserID],
command: guildCommandId,
roles: [testGuildId],
users: [testUserId],
});
await guildCommandFromGlobal?.permissions.set({
// @ts-expect-error
command: guildCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: guildCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await guildCommandFromGlobal?.permissions.add({
// @ts-expect-error
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await guildCommandFromGlobal?.permissions.has({ guild: testGuildID, permissionsID: testGuildID });
await guildCommandFromGlobal?.permissions.has({ guild: testGuildId, permissionsId: testGuildId });
// @ts-expect-error
await guildCommandFromGlobal?.permissions.remove({ guild: testGuildID, roles: [testGuildID] });
await guildCommandFromGlobal?.permissions.remove({ guild: testGuildId, roles: [testGuildId] });
// @ts-expect-error
await guildCommandFromGlobal?.permissions.remove({ guild: testGuildID, users: [testUserID] });
await guildCommandFromGlobal?.permissions.remove({ guild: testGuildId, users: [testUserId] });
// @ts-expect-error
await guildCommandFromGlobal?.permissions.remove({ guild: testGuildID, roles: [testGuildID], users: [testUserID] });
await guildCommandFromGlobal?.permissions.remove({ guild: testGuildId, roles: [testGuildId], users: [testUserId] });
await guildCommandFromGlobal?.permissions.set({
// @ts-expect-error
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await guildCommandFromGuild?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await guildCommandFromGuild?.permissions.has({ permissionsID: testGuildID });
await guildCommandFromGuild?.permissions.add({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
await guildCommandFromGuild?.permissions.has({ permissionsId: testGuildId });
await guildCommandFromGuild?.permissions.fetch({});
await guildCommandFromGuild?.permissions.remove({ roles: [testGuildID] });
await guildCommandFromGuild?.permissions.remove({ users: [testUserID] });
await guildCommandFromGuild?.permissions.remove({ roles: [testGuildID], users: [testUserID] });
await guildCommandFromGuild?.permissions.set({ permissions: [{ type: 'ROLE', id: testGuildID, permission: true }] });
await guildCommandFromGuild?.permissions.remove({ roles: [testGuildId] });
await guildCommandFromGuild?.permissions.remove({ users: [testUserId] });
await guildCommandFromGuild?.permissions.remove({ roles: [testGuildId], users: [testUserId] });
await guildCommandFromGuild?.permissions.set({ permissions: [{ type: 'ROLE', id: testGuildId, permission: true }] });
await guildCommandFromGuild?.permissions.add({
// @ts-expect-error
command: globalCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: globalCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await guildCommandFromGuild?.permissions.has({ command: guildCommandID, permissionsID: testGuildID });
await guildCommandFromGuild?.permissions.has({ command: guildCommandId, permissionsId: testGuildId });
// @ts-expect-error
await guildCommandFromGuild?.permissions.remove({ command: guildCommandID, roles: [testGuildID] });
await guildCommandFromGuild?.permissions.remove({ command: guildCommandId, roles: [testGuildId] });
// @ts-expect-error
await guildCommandFromGuild?.permissions.remove({ command: guildCommandID, users: [testUserID] });
await guildCommandFromGuild?.permissions.remove({ command: guildCommandId, users: [testUserId] });
await guildCommandFromGuild?.permissions.remove({
// @ts-expect-error
command: guildCommandID,
roles: [testGuildID],
users: [testUserID],
command: guildCommandId,
roles: [testGuildId],
users: [testUserId],
});
await guildCommandFromGuild?.permissions.set({
// @ts-expect-error
command: guildCommandID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
command: guildCommandId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
await guildCommandFromGuild?.permissions.add({
// @ts-expect-error
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
// @ts-expect-error
await guildCommandFromGuild?.permissions.has({ guild: testGuildID, permissionsID: testGuildID });
await guildCommandFromGuild?.permissions.has({ guild: testGuildId, permissionsId: testGuildId });
// @ts-expect-error
await guildCommandFromGuild?.permissions.remove({ guild: testGuildID, roles: [testGuildID] });
await guildCommandFromGuild?.permissions.remove({ guild: testGuildId, roles: [testGuildId] });
// @ts-expect-error
await guildCommandFromGuild?.permissions.remove({ guild: testGuildID, users: [testUserID] });
await guildCommandFromGuild?.permissions.remove({ guild: testGuildId, users: [testUserId] });
// @ts-expect-error
await guildCommandFromGuild?.permissions.remove({ guild: testGuildID, roles: [testGuildID], users: [testUserID] });
await guildCommandFromGuild?.permissions.remove({ guild: testGuildId, roles: [testGuildId], users: [testUserId] });
await guildCommandFromGuild?.permissions.set({
// @ts-expect-error
guild: testGuildID,
permissions: [{ type: 'ROLE', id: testGuildID, permission: true }],
guild: testGuildId,
permissions: [{ type: 'ROLE', id: testGuildId, permission: true }],
});
client.application?.commands.permissions.set({
guild: testGuildID,
guild: testGuildId,
fullPermissions: originalPermissions?.map((permissions, id) => ({ permissions, id })) ?? [],
});
});