#Internal Server Error
1 messages · Page 1 of 1 (latest)
My CronjobHandler#factOfTheDay method:
let facts = JSON.parse(readFileSync(join(__dirname, "..", "..", "facts.json")).toString()) as FactFile;
const fact = facts.facts[facts.i];
let channel = await (StammtischBot.channels.cache.get(StammtischBot.config.welcome.channel) as TextChannel).threads.create({
name: "Fakt des Tages #" + (facts.i + 1),
autoArchiveDuration: 1440
})
await channel.join()
let attempts = 1;
await sendFact()
async function sendFact() {
try {
// [...]
await channel.send({
content: "<@&" + StammtischBot.config.fotdrole + ">",
embeds: [
new MessageEmbed({
title: "Täglicher Fakt",
description: fact,
color: 1702481,
footer: {
text: stammtisch.name,
iconURL: stammtisch.iconURL() || undefined
}
})
]
})
} catch (error: any) {
Logger.error("Fehler beim Senden eines Fakts (Attempt " + attempts + ") " + (error.stack || error), Modules.SYSTEM)
}
}
Expected behaviour:
- Create new fact of the day thread
- Send the new fact message in the newly created thread
- Archive the old fact of the day thread
Actual behaviour:
- New Thread is created properly
2. No fact message is sent
The system automatically tries to send the fact 3 times (5 seconds timeout between each failed attempt) but all attempts fail and throw the same error.
If I try it with another bot on a testing server everything works without problems. No error occurs and the messages are sent properly so I can't reproduce this
PS: please ping me if you answer or if you need any further information
discord.js version: 13.6.0
nodejs version: 16
TypeScript version: 4.5.5
is this cronjobhandler.js ?
it's not the whole CronjobHandler file, it's only the factOfTheDay method
Where is line 49
This is the await channel.send() in my snippet above
that is still in issue. The error occurs for days now