Where does this log come from?

This appears when my client is starting but I am unsure where it is coming from, could it be the unhandled rejection or something?
{
url: 'wss://gateway.discord.gg',
session_start_limit: {
max_concurrency: 1,
remaining: 996,
reset_after: 86377933,
total: 1000
},
shards: 1
}
{
url: 'wss://gateway.discord.gg',
session_start_limit: {
max_concurrency: 1,
remaining: 996,
reset_after: 86377933,
total: 1000
},
shards: 1
}
My client is utilising discord-hybrid-sharding (I know it's not D.js, i'm sorry. The next code is d.js tho):
const settings = require(`../settings/client.json`);
const { ClusterManager } = require(`discord-hybrid-sharding`);
const { sendWebhook } = require("../functions/send-webhook");

const manager = new ClusterManager(`./manager.js`, {
totalShards: `auto`,
shardsPerClusters: 4,
token: settings.tokens.staging,
mode: `process`,
restarts: {
max: 10,
interval: 1000 * 60 * 60 // 1 hour
}
});

manager.on(`clusterCreate`, cluster => {
console.log(`[clusters ${cluster.id}] Cluster has been launched.`);
sendWebhook('manager', `cluster ${cluster.id} has been launched.`);

cluster.on(`spawn`, () => {
console.log(`[Cluster ${cluster.id}] Cluster has been spawned.`);
sendWebhook('manager', `cluster ${cluster.id} has been spawned.`);
});
});

manager.on(`debug`, message => {
console.log(`[Manager][Debug]${message}`);
});


try { manager.spawn({ timeout: -1 }); }
catch (error) { console.error(error); }

module.exports = manager;


process.on('unhandledRejection', function(reason) { console.log("here"); console.log(reason) });
const settings = require(`../settings/client.json`);
const { ClusterManager } = require(`discord-hybrid-sharding`);
const { sendWebhook } = require("../functions/send-webhook");

const manager = new ClusterManager(`./manager.js`, {
totalShards: `auto`,
shardsPerClusters: 4,
token: settings.tokens.staging,
mode: `process`,
restarts: {
max: 10,
interval: 1000 * 60 * 60 // 1 hour
}
});

manager.on(`clusterCreate`, cluster => {
console.log(`[clusters ${cluster.id}] Cluster has been launched.`);
sendWebhook('manager', `cluster ${cluster.id} has been launched.`);

cluster.on(`spawn`, () => {
console.log(`[Cluster ${cluster.id}] Cluster has been spawned.`);
sendWebhook('manager', `cluster ${cluster.id} has been spawned.`);
});
});

manager.on(`debug`, message => {
console.log(`[Manager][Debug]${message}`);
});


try { manager.spawn({ timeout: -1 }); }
catch (error) { console.error(error); }

module.exports = manager;


process.on('unhandledRejection', function(reason) { console.log("here"); console.log(reason) });
And then here's the manager.js file.
const { GClient } = require(`gcommands`);
const { GatewayIntentBits } = require(`discord.js`);
const { ClusterClient, getInfo } = require(`discord-hybrid-sharding`);
const { join } = require(`path`);
const settings = require(`../settings/client.json`);
const { sendWebhook } = require("../functions/send-webhook");
const { incrementStatistics } = require("../functions/increment-statistics");

const client = new GClient({
dirs: [
join(__dirname, `commands`),
join(__dirname, `events`)
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.DirectMessages
],
partials: [`CHANNEL`, `MESSAGE`, `REACTION`, `USER`],
shards: getInfo().SHARD_LIST,
shardCount: getInfo().TOTAL_SHARDS
});

client.cluster = new ClusterClient(client);

let environment = process.env.NODE_ENV;
if(!environment) environment = 'staging'; //CHANGE 'staging' TO 'production' ONCE READY TO DEPLOY!!!
try {
client.login(settings.tokens[environment]);
console.log(`[manager] successfully logged into ${environment} environment.`);
sendWebhook('manager', `cluster ${client.cluster.id} has logged in to ${environment} environment.`)
incrementStatistics(`client.restarts.${environment}`);
}
catch (error) { console.error(error) }


module.exports.client = client;
const { GClient } = require(`gcommands`);
const { GatewayIntentBits } = require(`discord.js`);
const { ClusterClient, getInfo } = require(`discord-hybrid-sharding`);
const { join } = require(`path`);
const settings = require(`../settings/client.json`);
const { sendWebhook } = require("../functions/send-webhook");
const { incrementStatistics } = require("../functions/increment-statistics");

const client = new GClient({
dirs: [
join(__dirname, `commands`),
join(__dirname, `events`)
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.DirectMessages
],
partials: [`CHANNEL`, `MESSAGE`, `REACTION`, `USER`],
shards: getInfo().SHARD_LIST,
shardCount: getInfo().TOTAL_SHARDS
});

client.cluster = new ClusterClient(client);

let environment = process.env.NODE_ENV;
if(!environment) environment = 'staging'; //CHANGE 'staging' TO 'production' ONCE READY TO DEPLOY!!!
try {
client.login(settings.tokens[environment]);
console.log(`[manager] successfully logged into ${environment} environment.`);
sendWebhook('manager', `cluster ${client.cluster.id} has logged in to ${environment} environment.`)
incrementStatistics(`client.restarts.${environment}`);
}
catch (error) { console.error(error) }


module.exports.client = client;
Where is the gateway log coming from because I don't want it to appear?
4 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
AJ
AJOP2y ago
I've checked all my console.log's and there's no indication of where the gateway response is coming from. actually, this is mostly gcommands. I'll go to them, but if anyone has any idea, please do feel free to let me know
GitHub
GitHub2y ago
<:pr_merge:852715380282753044> #9611 in discordjs/discord.js by Qjuh merged <t:1685385918:R> fix(WebSocketManager): always cache result of fetchGatewayInformation
AJ
AJOP2y ago
ah right okay, no problem then thank you
Want results from more Discord servers?
Add your server