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,13 +1,13 @@
'use strict';
const TextBasedChannel = require('./interfaces/TextBasedChannel');
const Role = require('./Role');
const Permissions = require('../util/Permissions');
const GuildMemberRoleManager = require('../managers/GuildMemberRoleManager');
const Base = require('./Base');
const VoiceState = require('./VoiceState');
const { Presence } = require('./Presence');
const Role = require('./Role');
const VoiceState = require('./VoiceState');
const TextBasedChannel = require('./interfaces/TextBasedChannel');
const { Error } = require('../errors');
const GuildMemberRoleManager = require('../managers/GuildMemberRoleManager');
const Permissions = require('../util/Permissions');
/**
* Represents a member of a guild on Discord.
@@ -152,12 +152,15 @@ class GuildMember extends Base {
* @readonly
*/
get presence() {
return this.guild.presences.cache.get(this.id) || new Presence(this.client, {
user: {
id: this.id,
},
guild: this.guild,
});
return (
this.guild.presences.cache.get(this.id) ||
new Presence(this.client, {
user: {
id: this.id,
},
guild: this.guild,
})
);
}
/**
@@ -293,7 +296,7 @@ class GuildMember extends Base {
data.channel_id = null;
data.channel = undefined;
}
if (data.roles) data.roles = data.roles.map(role => role instanceof Role ? role.id : role);
if (data.roles) data.roles = data.roles.map(role => (role instanceof Role ? role.id : role));
let endpoint = this.client.api.guilds(this.guild.id);
if (this.user.id === this.client.user.id) {
const keys = Object.keys(data);
@@ -342,7 +345,10 @@ class GuildMember extends Base {
* @returns {Promise<GuildMember>}
*/
kick(reason) {
return this.client.api.guilds(this.guild.id).members(this.user.id).delete({ reason })
return this.client.api
.guilds(this.guild.id)
.members(this.user.id)
.delete({ reason })
.then(() => this);
}