mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
chore: consistency/prettier (#3852)
* chore: consistency/prettier * chore: rebase * chore: rebase * chore: include typings * fix: include typings file in prettier lint-staged
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const TextBasedChannel = require('./interfaces/TextBasedChannel');
|
||||
const { Presence } = require('./Presence');
|
||||
const Snowflake = require('../util/Snowflake');
|
||||
const Base = require('./Base');
|
||||
const { Presence } = require('./Presence');
|
||||
const TextBasedChannel = require('./interfaces/TextBasedChannel');
|
||||
const { Error } = require('../errors');
|
||||
const Snowflake = require('../util/Snowflake');
|
||||
|
||||
/**
|
||||
* Represents a user on Discord.
|
||||
@@ -219,9 +219,11 @@ class User extends Base {
|
||||
async createDM() {
|
||||
const { dmChannel } = this;
|
||||
if (dmChannel && !dmChannel.partial) return dmChannel;
|
||||
const data = await this.client.api.users(this.client.user.id).channels.post({ data: {
|
||||
recipient_id: this.id,
|
||||
} });
|
||||
const data = await this.client.api.users(this.client.user.id).channels.post({
|
||||
data: {
|
||||
recipient_id: this.id,
|
||||
},
|
||||
});
|
||||
return this.client.actions.ChannelCreate.handle(data).channel;
|
||||
}
|
||||
|
||||
@@ -243,7 +245,8 @@ class User extends Base {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
equals(user) {
|
||||
let equal = user &&
|
||||
let equal =
|
||||
user &&
|
||||
this.id === user.id &&
|
||||
this.username === user.username &&
|
||||
this.discriminator === user.discriminator &&
|
||||
@@ -272,13 +275,16 @@ class User extends Base {
|
||||
}
|
||||
|
||||
toJSON(...props) {
|
||||
const json = super.toJSON({
|
||||
createdTimestamp: true,
|
||||
defaultAvatarURL: true,
|
||||
tag: true,
|
||||
lastMessage: false,
|
||||
lastMessageID: false,
|
||||
}, ...props);
|
||||
const json = super.toJSON(
|
||||
{
|
||||
createdTimestamp: true,
|
||||
defaultAvatarURL: true,
|
||||
tag: true,
|
||||
lastMessage: false,
|
||||
lastMessageID: false,
|
||||
},
|
||||
...props,
|
||||
);
|
||||
json.avatarURL = this.avatarURL();
|
||||
json.displayAvatarURL = this.displayAvatarURL();
|
||||
return json;
|
||||
|
||||
Reference in New Issue
Block a user