mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 01:01:30 +00:00
Teensy cleanup
This commit is contained in:
parent
853a3dfa04
commit
aad06c1116
3 changed files with 4 additions and 4 deletions
File diff suppressed because one or more lines are too long
|
|
@ -61,10 +61,10 @@ class ShardingManager extends EventEmitter {
|
||||||
this.spawnArgs = options.spawnArgs;
|
this.spawnArgs = options.spawnArgs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Token that will be passed to the shards. Also used for auto shard count.
|
* Token to use for obtaining the automatic shard count, and passing to shards
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
this.token = options.token || null;
|
this.token = options.token;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of shards that this manager has spawned
|
* A collection of shards that this manager has spawned
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ const botGateway = require('./Constants').Endpoints.botGateway;
|
||||||
*/
|
*/
|
||||||
module.exports = function getRecommendedShards(token) {
|
module.exports = function getRecommendedShards(token) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!token) reject(new Error('A token must be provided.'));
|
if (!token) throw new Error('A token must be provided.');
|
||||||
superagent.get(botGateway)
|
superagent.get(botGateway)
|
||||||
.set('Authorization', `Bot ${token.replace('Bot ', '')}`)
|
.set('Authorization', `Bot ${token.replace('Bot ', '')}`)
|
||||||
.end((err, res) => {
|
.end((err, res) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue