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