Skip to content

Commit

Permalink
Code linting
Browse files Browse the repository at this point in the history
Turns out object initializer spread is, in fact, part of ES2018. Turns out Node 8 does not, in
fact, support ES2018.
  • Loading branch information
abalabahaha committed Jun 10, 2019
1 parent 3a500d8 commit 836a041
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions lib/Client.js
Expand Up @@ -92,7 +92,7 @@ class Client extends EventEmitter {
constructor(token, options) {
super();

this.options = {
this.options = Object.assign({
autoreconnect: true,
compress: false,
connectionTimeout: 30000,
Expand All @@ -113,9 +113,8 @@ class Client extends EventEmitter {
restMode: false,
seedVoiceConnections: false,
ws: {},
agent: null,
...options
};
agent: null
}, options);
if(this.options.lastShardID === undefined && this.options.maxShards !== "auto") {
this.options.lastShardID = this.options.maxShards - 1;
}
Expand Down
5 changes: 2 additions & 3 deletions lib/command/CommandClient.js
Expand Up @@ -28,7 +28,7 @@ class CommandClient extends Client {
*/
constructor(token, options, commandOptions) {
super(token, options);
this.commandOptions = {
this.commandOptions = Object.assign({
defaultHelpCommand: true,
description: "An Eris-based Discord bot",
ignoreBots: true,
Expand All @@ -37,8 +37,7 @@ class CommandClient extends Client {
owner: "an unknown user",
prefix: "@mention ",
defaultCommandOptions: {},
...commandOptions
};
}, commandOptions);
this.guildPrefixes = {};
this.commands = {};
this.commandAliases = {};
Expand Down
4 changes: 2 additions & 2 deletions lib/gateway/Shard.js
Expand Up @@ -908,7 +908,7 @@ class Shard extends EventEmitter {
break;
}
case "CHANNEL_UPDATE": {
const channel = this.client.getChannel(packet.d.id);
let channel = this.client.getChannel(packet.d.id);
if(!channel) {
break;
}
Expand Down Expand Up @@ -939,7 +939,7 @@ class Shard extends EventEmitter {
rateLimitPerUser: channel.rateLimitPerUser
};
}
let oldType = channel.type;
const oldType = channel.type;
channel.update(packet.d);
if(oldType !== packet.d.type) {
this.emit("warn", `Channel ${packet.d.id} changed from type ${oldType} to ${packet.d.type}`);
Expand Down

0 comments on commit 836a041

Please sign in to comment.