Shard activity

bot.once(Events.ClientReady, async () => {
shardId = bot.shard.ids[0];

bot.user.setActivity({
name: `/help | Shard ${bot.shard.ids[0]}`,
type: ActivityType.Watching,
shardId: bot.shard.ids[0],
});
if (shardId === 0) {
console.log("Started Source");
client.login(process.env.SOURCE_TOKEN);
}
});
bot.once(Events.ClientReady, async () => {
shardId = bot.shard.ids[0];

bot.user.setActivity({
name: `/help | Shard ${bot.shard.ids[0]}`,
type: ActivityType.Watching,
shardId: bot.shard.ids[0],
});
if (shardId === 0) {
console.log("Started Source");
client.login(process.env.SOURCE_TOKEN);
}
});
i aim to set an activity for each individual running shard. the problem with my code is once another shard begins the bot activity is fully gone. how can i achieve my goal?
2 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Lawa
LawaOP5mo ago
sometimes after 3 to 5 days the activity is gone as well. even if another shard does not start. what causes that problem? the other client is a support bot for the support server. watches the bot uptime etc... discordjs website is currently down i'll check it out later
Want results from more Discord servers?
Add your server