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:
Crawl
2020-02-29 14:35:57 +01:00
committed by GitHub
parent 6650d50a56
commit c065156a88
127 changed files with 5198 additions and 4513 deletions

View File

@@ -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;