parent
9e7be09c6f
commit
6dea9bb096
@ -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 {
|
||||
* <info>This user's username, or their legacy tag (e.g. `hydrabolt#0001`)
|
||||
* if they're using the legacy username system</info>
|
||||
* @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
|
||||
|
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user