mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
ESLint stuff...
This commit is contained in:
@@ -1,71 +1,69 @@
|
||||
'use strict';
|
||||
|
||||
const TextBasedChannel = require('./interface/TextBasedChannel');
|
||||
|
||||
class GuildMember {
|
||||
constructor(guild, data) {
|
||||
this.client = guild.client;
|
||||
this.guild = guild;
|
||||
this.user = {};
|
||||
this._roles = [];
|
||||
if (data) {
|
||||
this.setup(data);
|
||||
}
|
||||
}
|
||||
constructor(guild, data) {
|
||||
this.client = guild.client;
|
||||
this.guild = guild;
|
||||
this.user = {};
|
||||
this._roles = [];
|
||||
if (data) {
|
||||
this.setup(data);
|
||||
}
|
||||
}
|
||||
|
||||
setup(data) {
|
||||
this.user = data.user;
|
||||
this.serverDeaf = data.deaf;
|
||||
this.serverMute = data.mute;
|
||||
this.selfMute = data.self_mute;
|
||||
this.selfDeaf = data.self_deaf;
|
||||
this.voiceSessionID = data.session_id;
|
||||
this.voiceChannelID = data.channel_id;
|
||||
this.joinDate = new Date(data.joined_at);
|
||||
this._roles = data.roles;
|
||||
}
|
||||
setup(data) {
|
||||
this.user = data.user;
|
||||
this.serverDeaf = data.deaf;
|
||||
this.serverMute = data.mute;
|
||||
this.selfMute = data.self_mute;
|
||||
this.selfDeaf = data.self_deaf;
|
||||
this.voiceSessionID = data.session_id;
|
||||
this.voiceChannelID = data.channel_id;
|
||||
this.joinDate = new Date(data.joined_at);
|
||||
this._roles = data.roles;
|
||||
}
|
||||
|
||||
get roles() {
|
||||
let list = [];
|
||||
let everyoneRole = this.guild.store.get('roles', this.guild.id);
|
||||
get roles() {
|
||||
const list = [];
|
||||
const everyoneRole = this.guild.store.get('roles', this.guild.id);
|
||||
|
||||
if (everyoneRole) {
|
||||
list.push(everyoneRole);
|
||||
}
|
||||
if (everyoneRole) {
|
||||
list.push(everyoneRole);
|
||||
}
|
||||
|
||||
for (let roleID of this._roles) {
|
||||
let role = this.guild.store.get('roles', roleID);
|
||||
if (role) {
|
||||
list.push(role);
|
||||
}
|
||||
}
|
||||
for (const roleID of this._roles) {
|
||||
const role = this.guild.store.get('roles', roleID);
|
||||
if (role) {
|
||||
list.push(role);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
get mute() {
|
||||
return this.selfMute || this.serverMute;
|
||||
}
|
||||
get mute() {
|
||||
return this.selfMute || this.serverMute;
|
||||
}
|
||||
|
||||
get deaf() {
|
||||
return this.selfDeaf || this.serverDeaf;
|
||||
}
|
||||
get deaf() {
|
||||
return this.selfDeaf || this.serverDeaf;
|
||||
}
|
||||
|
||||
get voiceChannel() {
|
||||
return this.guild.store.get('channels', this.voiceChannelID);
|
||||
}
|
||||
get voiceChannel() {
|
||||
return this.guild.store.get('channels', this.voiceChannelID);
|
||||
}
|
||||
|
||||
get id() {
|
||||
return this.user.id;
|
||||
}
|
||||
get id() {
|
||||
return this.user.id;
|
||||
}
|
||||
|
||||
deleteDM() {
|
||||
return this.client.rest.methods.DeleteChannel(this);
|
||||
}
|
||||
deleteDM() {
|
||||
return this.client.rest.methods.deleteChannel(this);
|
||||
}
|
||||
|
||||
kick() {
|
||||
return this.client.rest.methods.KickGuildMember(this.guild, this);
|
||||
}
|
||||
kick() {
|
||||
return this.client.rest.methods.kickGuildMember(this.guild, this);
|
||||
}
|
||||
}
|
||||
|
||||
TextBasedChannel.applyToClass(GuildMember);
|
||||
|
||||
Reference in New Issue
Block a user