mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
Change default token (#2843)
* Change default token Default `token` to `process.env.CLIENT_TOKEN` like client does. * 2/2 * 1/2
This commit is contained in:
@@ -104,13 +104,13 @@ class Client extends BaseClient {
|
|||||||
this.presence = new ClientPresence(this);
|
this.presence = new ClientPresence(this);
|
||||||
|
|
||||||
Object.defineProperty(this, 'token', { writable: true });
|
Object.defineProperty(this, 'token', { writable: true });
|
||||||
if (!browser && !this.token && 'CLIENT_TOKEN' in process.env) {
|
if (!browser && !this.token && 'DISCORD_TOKEN' in process.env) {
|
||||||
/**
|
/**
|
||||||
* Authorization token for the logged in bot
|
* Authorization token for the logged in bot
|
||||||
* <warn>This should be kept private at all times.</warn>
|
* <warn>This should be kept private at all times.</warn>
|
||||||
* @type {?string}
|
* @type {?string}
|
||||||
*/
|
*/
|
||||||
this.token = process.env.CLIENT_TOKEN;
|
this.token = process.env.DISCORD_TOKEN;
|
||||||
} else {
|
} else {
|
||||||
this.token = null;
|
this.token = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class ShardingManager extends EventEmitter {
|
|||||||
totalShards: 'auto',
|
totalShards: 'auto',
|
||||||
respawn: true,
|
respawn: true,
|
||||||
shardArgs: [],
|
shardArgs: [],
|
||||||
token: null,
|
token: process.env.DISCORD_TOKEN,
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user