From 6194d64c698b0b133ccbb595d0fe552479a4b026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Leit=C3=A3o?= <38259440+ImRodry@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:24:38 +0100 Subject: [PATCH 1/3] refactor(User): remove deprecation warning from tag --- packages/discord.js/src/structures/User.js | 6 ------ packages/discord.js/typings/index.d.ts | 1 - 2 files changed, 7 deletions(-) diff --git a/packages/discord.js/src/structures/User.js b/packages/discord.js/src/structures/User.js index e48fd0293ab3..19f40f905059 100644 --- a/packages/discord.js/src/structures/User.js +++ b/packages/discord.js/src/structures/User.js @@ -209,14 +209,8 @@ class User extends Base { * if they're using the legacy username system * @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 diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 026d487a17ff..58545ef8249f 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -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; From ab6093cd3ef683108b997247db0e809e2ac8fe59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Leit=C3=A3o?= <38259440+ImRodry@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:32:17 +0100 Subject: [PATCH 2/3] fix: remove unnecessary declarations --- packages/discord.js/src/structures/User.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/discord.js/src/structures/User.js b/packages/discord.js/src/structures/User.js index 19f40f905059..15d219be66b2 100644 --- a/packages/discord.js/src/structures/User.js +++ b/packages/discord.js/src/structures/User.js @@ -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,7 +7,6 @@ const Base = require('./Base'); const TextBasedChannel = require('./interfaces/TextBasedChannel'); const UserFlagsBitField = require('../util/UserFlagsBitField'); -let tagDeprecationEmitted = false; /** * Represents a user on Discord. From 5f39bcfc8369c4069ca0edfa4447632df300a610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Leit=C3=A3o?= <38259440+ImRodry@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:29:02 +0100 Subject: [PATCH 3/3] style: fix formatting issue --- packages/discord.js/src/structures/User.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/discord.js/src/structures/User.js b/packages/discord.js/src/structures/User.js index 15d219be66b2..33f8e66838fd 100644 --- a/packages/discord.js/src/structures/User.js +++ b/packages/discord.js/src/structures/User.js @@ -7,7 +7,6 @@ const Base = require('./Base'); const TextBasedChannel = require('./interfaces/TextBasedChannel'); const UserFlagsBitField = require('../util/UserFlagsBitField'); - /** * Represents a user on Discord. * @implements {TextBasedChannel}