mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(User): remove deprecation warning from tag (#9660)
* refactor(User): remove deprecation warning from tag * fix: remove unnecessary declarations * style: fix formatting issue --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const process = require('node:process');
|
||||
const { userMention } = require('@discordjs/builders');
|
||||
const { calculateUserDefaultAvatarIndex } = require('@discordjs/rest');
|
||||
const { DiscordSnowflake } = require('@sapphire/snowflake');
|
||||
@@ -8,8 +7,6 @@ const Base = require('./Base');
|
||||
const TextBasedChannel = require('./interfaces/TextBasedChannel');
|
||||
const UserFlagsBitField = require('../util/UserFlagsBitField');
|
||||
|
||||
let tagDeprecationEmitted = false;
|
||||
|
||||
/**
|
||||
* Represents a user on Discord.
|
||||
* @implements {TextBasedChannel}
|
||||
@@ -209,14 +206,8 @@ class User extends Base {
|
||||
* if they're using the legacy username system</info>
|
||||
* @type {?string}
|
||||
* @readonly
|
||||
* @deprecated Use {@link User#username} instead.
|
||||
*/
|
||||
get tag() {
|
||||
if (!tagDeprecationEmitted) {
|
||||
process.emitWarning('User#tag is deprecated. Use User#username instead.', 'DeprecationWarning');
|
||||
tagDeprecationEmitted = true;
|
||||
}
|
||||
|
||||
return typeof this.username === 'string'
|
||||
? this.discriminator === '0'
|
||||
? this.username
|
||||
|
||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -3067,7 +3067,6 @@ export class User extends PartialTextBasedChannel(Base) {
|
||||
public id: Snowflake;
|
||||
public get partial(): false;
|
||||
public system: boolean;
|
||||
/** @deprecated Use {@link User#username} instead. */
|
||||
public get tag(): string;
|
||||
public username: string;
|
||||
public avatarURL(options?: ImageURLOptions): string | null;
|
||||
|
||||
Reference in New Issue
Block a user