dev_panda
dev_panda
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
about this
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
i will tell them
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
Alright
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
i'll do that now and try to reproduce the issue.
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
i asked their support server, and they mentioned it's unlikely to be a hybrid hosting issue, suggesting it might be related to Discord.js or a network problem
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
I've been using Discord.js as my main library
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
logs1 | [WS => Shard 124] Heartbeat acknowledged, latency of 107ms. 1 | [WS => Shard 265] Heartbeat acknowledged, latency of 105ms. 1 | [WS => Shard 125] Heartbeat acknowledged, latency of 111ms. 1 | [WS => Shard 267] Heartbeat acknowledged, latency of 115ms. 1 | [WS => Shard 19] Heartbeat acknowledged, latency of 105ms. 1 | [WS => Shard 300] Heartbeat acknowledged, latency of 106ms. 1 | [WS => Shard 117] Heartbeat acknowledged, latency of 107ms. 1 | [WS => Shard 118] Heartbeat acknowledged, latency of 111ms. 1 | [WS => Shard 133] Destroying shard 1 | Reason: Told to reconnect by Discord 1 | Code: 4200 1 | Recover: Resume 1 | [WS => Shard 133] Connection status during destroy 1 | Needs closing: true 1 | Ready state: 1 1 | [WS => Shard 202] Heartbeat acknowledged, latency of 106ms. 1 | [WS => Shard 233] Heartbeat acknowledged, latency of 112ms. 1 | [WS => Shard 150] Heartbeat acknowledged, latency of 105ms. 1 | [WS => Shard 133] Connecting to wss://gateway-us-east1-c.discord.gg?v=10&encoding=json 1 | [WS => Shard 133] Waiting for event hello for 60000ms 1 | [WS => Shard 133] Resuming session 1 | resume url: wss://gateway-us-east1-c.discord.gg 1 | sequence: 32204 1 | shard id: 133 1 | [WS => Shard 133] Resumed and replayed 5 events
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
index.ts
const { Client } = require('discord-cross-hosting');
import { ClusterManager, HeartbeatManager, ReClusterManager } from 'discord-hybrid-sharding';
import dotenv from 'dotenv';

dotenv.config();

const client = new Client({
agent: 'bot',
host: '111.666.4.666',
port: 0000,
authToken: process.env.AUTH_TOKEN,
rollingRestarts: false,
});

client.connect();

client.on('ready', () => {
console.log('Cluster Client is ready');
});

const manager = new ClusterManager(`${__dirname}/src/musico.js`, {
totalShards: 328,
totalClusters: 33,
mode: 'process',
token: process.env.TOKEN,
});

manager.extend(
new HeartbeatManager({
interval: 5000,
maxMissedHeartbeats: 5,
}),
new ReClusterManager()
);

manager.on('clusterCreate', cluster => {
console.log(`Launched Cluster ${cluster.id}`);
});

client.listen(manager);
client
.requestShardData()
.then(e => {
if (!e) return;
manager.totalShards = e.totalShards;
manager.totalClusters = e.shardList.length;
manager.shardList = e.shardList;
manager.clusterList = e.clusterList;
manager.spawn({ timeout: -1 });
})
.catch(e => console.log(e));
const { Client } = require('discord-cross-hosting');
import { ClusterManager, HeartbeatManager, ReClusterManager } from 'discord-hybrid-sharding';
import dotenv from 'dotenv';

dotenv.config();

const client = new Client({
agent: 'bot',
host: '111.666.4.666',
port: 0000,
authToken: process.env.AUTH_TOKEN,
rollingRestarts: false,
});

client.connect();

client.on('ready', () => {
console.log('Cluster Client is ready');
});

const manager = new ClusterManager(`${__dirname}/src/musico.js`, {
totalShards: 328,
totalClusters: 33,
mode: 'process',
token: process.env.TOKEN,
});

manager.extend(
new HeartbeatManager({
interval: 5000,
maxMissedHeartbeats: 5,
}),
new ReClusterManager()
);

manager.on('clusterCreate', cluster => {
console.log(`Launched Cluster ${cluster.id}`);
});

client.listen(manager);
client
.requestShardData()
.then(e => {
if (!e) return;
manager.totalShards = e.totalShards;
manager.totalClusters = e.shardList.length;
manager.shardList = e.shardList;
manager.clusterList = e.clusterList;
manager.spawn({ timeout: -1 });
})
.catch(e => console.log(e));
53 replies
DIAdiscord.js - Imagine an app
Created by dev_panda on 10/2/2024 in #djs-questions
Bot Appearing Offline on Some Shards
Server.ts
const { Bridge } = require('discord-cross-hosting');
import dotenv from "dotenv"
dotenv.config();

const server = new Bridge({
port: 5050,
authToken: process.env.AUTH_TOKEN,
totalShards: 656,
totalMachines: 2,
shardsPerCluster: 8,
token: process.env.TOKEN,
});

server.on('debug', console.log);
server.start();
server.on('ready', url => {
console.log('Server is ready' + url);
setInterval(() => {
server.broadcastEval('this.guilds.cache.size').then(console.log).catch(console.log);
}, 10000);
});
const { Bridge } = require('discord-cross-hosting');
import dotenv from "dotenv"
dotenv.config();

const server = new Bridge({
port: 5050,
authToken: process.env.AUTH_TOKEN,
totalShards: 656,
totalMachines: 2,
shardsPerCluster: 8,
token: process.env.TOKEN,
});

server.on('debug', console.log);
server.start();
server.on('ready', url => {
console.log('Server is ready' + url);
setInterval(() => {
server.broadcastEval('this.guilds.cache.size').then(console.log).catch(console.log);
}, 10000);
});
53 replies