Skip to content

Commit ff8d901

Browse files
committed
Lint, add recent props to toJSON()
1 parent 39dd05f commit ff8d901

File tree

11 files changed

+35
-22
lines changed

11 files changed

+35
-22
lines changed

lib/Client.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,31 +2522,31 @@ class Client extends EventEmitter {
25222522

25232523
toJSON(props = []) {
25242524
return Base.prototype.toJSON.call(this, [
2525-
"options",
2526-
"requestHandler",
2527-
"ready",
2525+
"application",
25282526
"bot",
2529-
"startTime",
2530-
"lastConnect",
25312527
"channelGuildMap",
2532-
"shards",
25332528
"gatewayURL",
25342529
"groupChannels",
25352530
"guilds",
2531+
"guildShardMap",
2532+
"lastConnect",
2533+
"lastReconnectDelay",
2534+
"notes",
2535+
"options",
2536+
"presence",
25362537
"privateChannelMap",
25372538
"privateChannels",
2538-
"guildShardMap",
2539-
"unavailableGuilds",
2539+
"ready",
2540+
"reconnectAttempts",
25402541
"relationships",
2541-
"users",
2542-
"presence",
2542+
"requestHandler",
2543+
"shards",
2544+
"startTime",
2545+
"unavailableGuilds",
25432546
"userGuildSettings",
2547+
"users",
25442548
"userSettings",
2545-
"notes",
25462549
"voiceConnections",
2547-
"lastReconnectDelay",
2548-
"reconnectAttempts",
2549-
"application",
25502550
...props
25512551
]);
25522552
}

lib/gateway/Shard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const User = require("../structures/User");
1515
const Invite = require("../structures/Invite");
1616
const Constants = require("../Constants");
1717

18-
let WebSocket = typeof window !== "undefined" ? require("../util/BrowserWebSocket") : require("ws");
18+
const WebSocket = typeof window !== "undefined" ? require("../util/BrowserWebSocket") : require("ws");
1919

2020
let EventEmitter;
2121
try {
@@ -141,7 +141,7 @@ class Shard extends EventEmitter {
141141
try {
142142
if(options.reconnect && this.sessionID) {
143143
if(this.ws.readyState === WebSocket.OPEN) {
144-
this.ws.close(4901, "Eris: reconnect")
144+
this.ws.close(4901, "Eris: reconnect");
145145
} else {
146146
this.emit("debug", `Terminating websocket (state: ${this.ws.readyState})`, this.id);
147147
this.ws.terminate();

lib/structures/Guild.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ class Guild extends Base {
968968
"vanityURL",
969969
"verificationLevel",
970970
"voiceStates",
971+
"welcomeScreen",
971972
"widgetChannelID",
972973
"widgetEnabled",
973974
...props

lib/structures/GuildAuditLogEntry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class GuildAuditLogEntry extends Base {
6868
if(data.options.channel_id) {
6969
this.channel = guild.channels.get(data.options.channel_id);
7070
if(data.options.message_id) {
71-
this.message = this.channel.messages.get(data.options.message_id) || {id: data.options.message_id};
71+
this.message = this.channel && this.channel.messages.get(data.options.message_id) || {id: data.options.message_id};
7272
}
7373
}
7474
if(data.options.delete_member_days) {

lib/structures/GuildIntegration.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ class GuildIntegration extends Base {
8282
toJSON(props = []) {
8383
return super.toJSON([
8484
"account",
85+
"application",
8586
"enabled",
8687
"enableEmoticons",
8788
"expireBehavior",
8889
"expireGracePeriod",
8990
"name",
91+
"revoked",
9092
"roleID",
9193
"subscriberCount",
9294
"syncedAt",

lib/structures/Member.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const VoiceState = require("./VoiceState");
2727
* @prop {Number} joinedAt Timestamp of when the member joined the guild
2828
* @prop {String} mention A string that mentions the member
2929
* @prop {String?} nick The server nickname of the member
30-
* @prop {Boolean} [pending] Whether the member has passed the guild's Membership Screening requirements
30+
* @prop {Boolean?} pending Whether the member has passed the guild's Membership Screening requirements
3131
* @prop {Permission} permission [DEPRECATED] The guild-wide permissions of the member. Use Member#permissions instead
3232
* @prop {Permission} permissions The guild-wide permissions of the member
3333
* @prop {Number} premiumSince Timestamp of when the member boosted the guild
@@ -231,6 +231,7 @@ class Member extends Base {
231231
"game",
232232
"joinedAt",
233233
"nick",
234+
"pending",
234235
"premiumSince",
235236
"roles",
236237
"status",

lib/structures/Message.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ class Message extends Base {
8080
this._client.emit("error", new Error("MESSAGE_CREATE but no message author:\n" + JSON.stringify(data, null, 2)));
8181
}
8282
if(data.referenced_message) {
83-
const channel = data.referenced_message.guild_id
84-
? this._client.guilds.get(data.referenced_message.guild_id).channels.get(data.referenced_message.channel_id)
85-
: this._client.privateChannels.get(data.referenced_message.channel_id);
83+
const channel = this._client.getChannel(data.referenced_message.channel_id);
8684
if(channel) {
8785
this.referencedMessage = channel.messages.update(data.referenced_message, this._client);
8886
} else {
@@ -472,6 +470,7 @@ class Message extends Base {
472470
"reactions",
473471
"referencedMesssage",
474472
"roleMentions",
473+
"stickers",
475474
"timestamp",
476475
"tts",
477476
"type",

lib/structures/StageChannel.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ class StageChannel extends VoiceChannel {
1414
this.topic = data.topic;
1515
}
1616
}
17+
18+
toJSON(props = []) {
19+
return super.toJSON([
20+
"topic",
21+
...props
22+
]);
23+
}
1724
}
1825

1926
module.exports = StageChannel;

lib/structures/VoiceChannel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ class VoiceChannel extends GuildChannel {
8181
toJSON(props = []) {
8282
return super.toJSON([
8383
"bitrate",
84+
"rtcRegion",
8485
"userLimit",
86+
"videoQualityMode",
8587
"voiceMembers",
8688
...props
8789
]);

lib/structures/VoiceState.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class VoiceState extends Base {
6868
"channelID",
6969
"deaf",
7070
"mute",
71+
"requestToSpeakTimestamp",
7172
"selfDeaf",
7273
"selfMute",
7374
"selfStream",

0 commit comments

Comments
 (0)