mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
types(*): create mention types (#6003)
This commit is contained in:
16
typings/index.d.ts
vendored
16
typings/index.d.ts
vendored
@@ -439,7 +439,7 @@ declare module 'discord.js' {
|
|||||||
public fetch(force?: boolean): Promise<Channel>;
|
public fetch(force?: boolean): Promise<Channel>;
|
||||||
public isText(): this is TextChannel | DMChannel | NewsChannel | ThreadChannel;
|
public isText(): this is TextChannel | DMChannel | NewsChannel | ThreadChannel;
|
||||||
public isThread(): this is ThreadChannel;
|
public isThread(): this is ThreadChannel;
|
||||||
public toString(): string;
|
public toString(): ChannelMention;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Client extends BaseClient {
|
export class Client extends BaseClient {
|
||||||
@@ -1103,7 +1103,7 @@ declare module 'discord.js' {
|
|||||||
public permissionsIn(channel: GuildChannelResolvable): Readonly<Permissions>;
|
public permissionsIn(channel: GuildChannelResolvable): Readonly<Permissions>;
|
||||||
public setNickname(nickname: string | null, reason?: string): Promise<GuildMember>;
|
public setNickname(nickname: string | null, reason?: string): Promise<GuildMember>;
|
||||||
public toJSON(): unknown;
|
public toJSON(): unknown;
|
||||||
public toString(): string;
|
public toString(): MemberMention;
|
||||||
public valueOf(): string;
|
public valueOf(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1757,7 +1757,7 @@ declare module 'discord.js' {
|
|||||||
public setPermissions(permissions: PermissionResolvable, reason?: string): Promise<Role>;
|
public setPermissions(permissions: PermissionResolvable, reason?: string): Promise<Role>;
|
||||||
public setPosition(position: number, options?: SetRolePositionOptions): Promise<Role>;
|
public setPosition(position: number, options?: SetRolePositionOptions): Promise<Role>;
|
||||||
public toJSON(): unknown;
|
public toJSON(): unknown;
|
||||||
public toString(): string;
|
public toString(): RoleMention;
|
||||||
|
|
||||||
public static comparePositions(role1: Role, role2: Role): number;
|
public static comparePositions(role1: Role, role2: Role): number;
|
||||||
}
|
}
|
||||||
@@ -2052,7 +2052,7 @@ declare module 'discord.js' {
|
|||||||
public equals(user: User): boolean;
|
public equals(user: User): boolean;
|
||||||
public fetch(force?: boolean): Promise<User>;
|
public fetch(force?: boolean): Promise<User>;
|
||||||
public fetchFlags(force?: boolean): Promise<UserFlags>;
|
public fetchFlags(force?: boolean): Promise<UserFlags>;
|
||||||
public toString(): string;
|
public toString(): UserMention;
|
||||||
public typingDurationIn(channel: ChannelResolvable): number;
|
public typingDurationIn(channel: ChannelResolvable): number;
|
||||||
public typingIn(channel: ChannelResolvable): boolean;
|
public typingIn(channel: ChannelResolvable): boolean;
|
||||||
public typingSinceIn(channel: ChannelResolvable): Date;
|
public typingSinceIn(channel: ChannelResolvable): Date;
|
||||||
@@ -3034,6 +3034,8 @@ declare module 'discord.js' {
|
|||||||
around?: Snowflake;
|
around?: Snowflake;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ChannelMention = `<#${Snowflake}>`;
|
||||||
|
|
||||||
interface ChannelPosition {
|
interface ChannelPosition {
|
||||||
channel: ChannelResolvable;
|
channel: ChannelResolvable;
|
||||||
lockPermissions?: boolean;
|
lockPermissions?: boolean;
|
||||||
@@ -3715,6 +3717,8 @@ declare module 'discord.js' {
|
|||||||
stack: string;
|
stack: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MemberMention = UserMention | `<@!${Snowflake}>`;
|
||||||
|
|
||||||
type MembershipState = keyof typeof MembershipStates;
|
type MembershipState = keyof typeof MembershipStates;
|
||||||
|
|
||||||
type MessageActionRowComponent = MessageButton | MessageSelectMenu;
|
type MessageActionRowComponent = MessageButton | MessageSelectMenu;
|
||||||
@@ -4214,6 +4218,8 @@ declare module 'discord.js' {
|
|||||||
mentionable?: boolean;
|
mentionable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RoleMention = '@everyone' | `<@&${Snowflake}>`;
|
||||||
|
|
||||||
interface RolePosition {
|
interface RolePosition {
|
||||||
role: RoleResolvable;
|
role: RoleResolvable;
|
||||||
position: number;
|
position: number;
|
||||||
@@ -4343,6 +4349,8 @@ declare module 'discord.js' {
|
|||||||
| 'EARLY_VERIFIED_BOT_DEVELOPER'
|
| 'EARLY_VERIFIED_BOT_DEVELOPER'
|
||||||
| 'DISCORD_CERTIFIED_MODERATOR';
|
| 'DISCORD_CERTIFIED_MODERATOR';
|
||||||
|
|
||||||
|
type UserMention = `<@${Snowflake}>`;
|
||||||
|
|
||||||
type UserResolvable = User | Snowflake | Message | GuildMember | ThreadMember;
|
type UserResolvable = User | Snowflake | Message | GuildMember | ThreadMember;
|
||||||
|
|
||||||
interface Vanity {
|
interface Vanity {
|
||||||
|
|||||||
Reference in New Issue
Block a user