Bot not able to login. After starting other sample code, logging in with same token, login possible

Hello there. I'm having a weird problem for a few months now. I also asked here about it an never got it resolved yet. I only found a weird temporary fix now. So, my bot is starting, but not able to log in. basically all information im getting is in screenshot one. Now, today i discovered, when im starting a sample bot, like this:
import {Client, GatewayIntentBits} from "discord.js"

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

client.on("ready", ()=> {
console.log("debug")
})

client.login(<token>)
import {Client, GatewayIntentBits} from "discord.js"

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

client.on("ready", ()=> {
console.log("debug")
})

client.login(<token>)
it will login, and after that i can start my bot (or rather my code) just fine and it will be able to log in for about 2-3 days. any ideas?
No description
6 Replies
d.js toolkit
d.js toolkit7mo 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!
EtzBetz
EtzBetz7mo ago
Also this issue is popping up on my local dev set up and on my prod setup.. also in my docker setup
EtzBetz
EtzBetz7mo ago
this is the main code of my bot
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
souji
souji7mo ago
as is random invite links - just saying
EtzBetz
EtzBetz7mo ago
The one mentioning Blackboard? It is from my bot. My bot does scrape websites, which works fine, but the discord part isn't It will do in intervals, but also once at startup, yes. I'm very very confident that that's not the reason because it worked very fine for about 2 years before and also it works for some reason when I'm starting the dummy bot once before (I also disabled all scrapers in tests and it still won't work)