From 6dea9bb0966777ce0bfc807e7242b4d5618ae4a7 Mon Sep 17 00:00:00 2001 From: Elysia <71698422+aiko-chan-ai@users.noreply.github.com> Date: Tue, 11 Jul 2023 11:56:20 +0700 Subject: [PATCH] refactor(User): remove deprecation warning from tag #9660 djs --- src/structures/User.js | 8 -------- typings/index.d.ts | 1 - 2 files changed, 9 deletions(-) diff --git a/src/structures/User.js b/src/structures/User.js index a220c86..1aa3638 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -1,6 +1,5 @@ 'use strict'; -const process = require('node:process'); const { Collection } = require('@discordjs/collection'); const Base = require('./Base'); const ClientApplication = require('./ClientApplication'); @@ -12,8 +11,6 @@ const SnowflakeUtil = require('../util/SnowflakeUtil'); const UserFlags = require('../util/UserFlags'); const Util = require('../util/Util'); -let tagDeprecationEmitted = false; - /** * Represents a user on Discord. * @implements {TextBasedChannel} @@ -555,14 +552,9 @@ class User extends Base { * This user's username, or their legacy tag (e.g. `hydrabolt#0001`) * if they're using the legacy username system * @type {?string} - * @deprecated Use {@link User#username} instead. * @readonly */ 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 diff --git a/typings/index.d.ts b/typings/index.d.ts index 047f543..c935ad6 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3273,7 +3273,6 @@ export class User extends PartialTextBasedChannel(Base) { public id: Snowflake; public readonly partial: false; public system: boolean; - /** @deprecated Use {@link User#username} instead. */ public readonly tag: string; public username: string; public readonly note: string | null;