jaymart
jaymart
DIAdiscord.js - Imagine an app
Created by jaymart on 7/30/2023 in #djs-questions
Sharding is required
I have setup sharding but i still get sharding is required and bot wont start.
// Define Packages
const { Client, GatewayIntentBits } = require('discord.js');
const config = require('./config.json');
const {ClusterClient, getInfo} = require('discord-hybrid-sharding');
const info = getInfo()

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.cluster = new ClusterClient(client);
client.login(config.discord.token);
// Define Packages
const { Client, GatewayIntentBits } = require('discord.js');
const config = require('./config.json');
const {ClusterClient, getInfo} = require('discord-hybrid-sharding');
const info = getInfo()

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.cluster = new ClusterClient(client);
client.login(config.discord.token);
const { ClusterManager } = require('discord-hybrid-sharding')
const BOT_TOKEN = ''
const manager = new ClusterManager(`./bot.js`, {
totalShards: 1,
totalClusters: 1,
mode: 'process',
token: BOT_TOKEN,
})
manager.on('clusterCreate', cluster => console.log(`Launched cluster ${cluster.id}`))
manager.spawn({amount: 1, delay: 10000})
const { ClusterManager } = require('discord-hybrid-sharding')
const BOT_TOKEN = ''
const manager = new ClusterManager(`./bot.js`, {
totalShards: 1,
totalClusters: 1,
mode: 'process',
token: BOT_TOKEN,
})
manager.on('clusterCreate', cluster => console.log(`Launched cluster ${cluster.id}`))
manager.spawn({amount: 1, delay: 10000})
11 replies