parent
9e7be09c6f
commit
6dea9bb096
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const process = require('node:process');
|
|
||||||
const { Collection } = require('@discordjs/collection');
|
const { Collection } = require('@discordjs/collection');
|
||||||
const Base = require('./Base');
|
const Base = require('./Base');
|
||||||
const ClientApplication = require('./ClientApplication');
|
const ClientApplication = require('./ClientApplication');
|
||||||
@ -12,8 +11,6 @@ const SnowflakeUtil = require('../util/SnowflakeUtil');
|
|||||||
const UserFlags = require('../util/UserFlags');
|
const UserFlags = require('../util/UserFlags');
|
||||||
const Util = require('../util/Util');
|
const Util = require('../util/Util');
|
||||||
|
|
||||||
let tagDeprecationEmitted = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a user on Discord.
|
* Represents a user on Discord.
|
||||||
* @implements {TextBasedChannel}
|
* @implements {TextBasedChannel}
|
||||||
@ -555,14 +552,9 @@ class User extends Base {
|
|||||||
* <info>This user's username, or their legacy tag (e.g. `hydrabolt#0001`)
|
* <info>This user's username, or their legacy tag (e.g. `hydrabolt#0001`)
|
||||||
* if they're using the legacy username system</info>
|
* if they're using the legacy username system</info>
|
||||||
* @type {?string}
|
* @type {?string}
|
||||||
* @deprecated Use {@link User#username} instead.
|
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get tag() {
|
get tag() {
|
||||||
if (!tagDeprecationEmitted) {
|
|
||||||
process.emitWarning('User#tag is deprecated. Use User#username instead.', 'DeprecationWarning');
|
|
||||||
tagDeprecationEmitted = true;
|
|
||||||
}
|
|
||||||
return typeof this.username === 'string'
|
return typeof this.username === 'string'
|
||||||
? this.discriminator === '0'
|
? this.discriminator === '0'
|
||||||
? this.username
|
? 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 id: Snowflake;
|
||||||
public readonly partial: false;
|
public readonly partial: false;
|
||||||
public system: boolean;
|
public system: boolean;
|
||||||
/** @deprecated Use {@link User#username} instead. */
|
|
||||||
public readonly tag: string;
|
public readonly tag: string;
|
||||||
public username: string;
|
public username: string;
|
||||||
public readonly note: string | null;
|
public readonly note: string | null;
|
||||||
|
Loading…
Reference in New Issue
Block a user