DaveY
DaveY
DIAdiscord.js - Imagine an app
Created by DaveY on 11/2/2023 in #djs-questions
Does Sharding take advantage of multiple CPUS?
I've read through the docs on Sharding and have performed the basic Sharding Manager implementation. I'm hoping to take advantage of it when my bot is larger, and would like to plan for that. To me, that means understanding how I would need to add resources so the bot can serve more guilds effectively. The main question I had is if it does something to take advantage of multiple CPUs. ie when it spawns a shard, is that new shard going to live on a new thread/CPU, or just add more work for the existing process the sharding manager was created on?
3 replies
DIAdiscord.js - Imagine an app
Created by DaveY on 10/26/2023 in #djs-questions
Client cannot login
After 6 months of running, I began having random issues yesterday with my bot not responding to interactions, and eventually not logging in, then other bots on the same machine not working. I've been going through lots of debugging and diagnosis, including downgrading to other versions, etc. I've only seen one rate limit error, the last time it successfully logged in. After that, no other bots on the machine can get through a client.login This is what the last successful connect looked like (see pitcure) where it ran for 6-7 hours, then had a long period of inactivity with log that looked like this:
[WS => Shard 0] Heartbeat acknowledged, latency of 20ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 20ms.
59 replies
DIAdiscord.js - Imagine an app
Created by DaveY on 10/24/2023 in #djs-questions
Possible IP Ban? Where to look for error
Hi! After running smoothly for several months, my bot can't login any longer from a particular server. The server has network connectivity, but there is no progression when calling client.login. I am handling:
client.once('ready', async () => {
console.log('Conquest Bot is ready');
await runStuff();
});

client.on('rateLimit', rateLimitInfo => {
console.log(`DISCORD Rate limit hit ${rateLimitInfo.timeDifference ? rateLimitInfo.timeDifference : rateLimitInfo.timeOut ? rateLimitInfo.timeOut : 'Unkown Timeout '}`);
});

client.on('error', error => {
console.log("Discord Client Error");
console.log(error);
});

client
.on("debug", console.log)
.on("warn", console.log)
client.once('ready', async () => {
console.log('Conquest Bot is ready');
await runStuff();
});

client.on('rateLimit', rateLimitInfo => {
console.log(`DISCORD Rate limit hit ${rateLimitInfo.timeDifference ? rateLimitInfo.timeDifference : rateLimitInfo.timeOut ? rateLimitInfo.timeOut : 'Unkown Timeout '}`);
});

client.on('error', error => {
console.log("Discord Client Error");
console.log(error);
});

client
.on("debug", console.log)
.on("warn", console.log)
But the client.login simply does nothing. When running locally or on another server, I get the ready handler. Is there an event I can listen to which will tell me why I can't login? In the discord devs Discord, someone noted that it would say clearly in the response if I'm IP Banned.
9 replies
DIAdiscord.js - Imagine an app
Created by DaveY on 7/26/2023 in #djs-questions
Detect if an Ephemeral message is still onscreen?
I am sending an Ephemeral message containing an embed to the user with interaction.reply. I store that reply message in a variable to be able to edit it. From there on, I edit the Embed on a timer. If the user dismisses the message I'd like to be able to stop that processing. Is this possible? When I check to see if the message exists by ID, or to fetch it, it always seems to come back OK, I can't see any property on the the message which indicates it's been dismissed.
15 replies