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:
Rodrigo Leitão
2023-07-06 17:49:03 +01:00
committed by GitHub
parent 0803eb562b
commit cf8012c200
2 changed files with 0 additions and 10 deletions

View File

@@ -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

View File

@@ -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;