Webhook not sending

This is compiled Typescript, but im just lost on where the issue is... my console.log()s arent passing the hook.send() and there's no error being caught or anything?
try {
console.log('before send')
await hook.send({
username: `Twitch Reminder`,
embeds: [embed],
}).catch(e => {
console.log(e)
});
console.log('after send')
shouldSendResponse = true;
Logger_1.logger.sysDebug.success(`Sent Reminder to DiscordWebhook with the following ID: (${hook.id})`);
}
catch (error) {
Logger_1.logger.sysDebug.error(error);
shouldSendResponse = true;
}
try {
console.log('before send')
await hook.send({
username: `Twitch Reminder`,
embeds: [embed],
}).catch(e => {
console.log(e)
});
console.log('after send')
shouldSendResponse = true;
Logger_1.logger.sysDebug.success(`Sent Reminder to DiscordWebhook with the following ID: (${hook.id})`);
}
catch (error) {
Logger_1.logger.sysDebug.error(error);
shouldSendResponse = true;
}
4 Replies
d.js toolkit
d.js toolkitβ€’15mo 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!
itsjusttriz
itsjusttrizOPβ€’15mo ago
discord.js: 14.11.0 node: 18.12.1
πŸŒΊπŸ‡«πŸ‡· Shigu :3 🌺
What's the source code?
itsjusttriz
itsjusttrizOPβ€’15mo ago
This is all the source code you need? It works sometimes... just fails more than it works. The times it doesnt work, before send log works..then it stops there. I have this though, and nothing gets posted to my twitch chat?
hook.rest.on('rateLimited', async (info) => {
const timeLeft = info.timeToReset / 1000;
await this.chat.say(this.settings.debug.logChannel, `@itsjusttriz -> DiscordWebhook for channel (${channel}) has been rate-limited. Time left: ${timeLeft}`);
hook.rest.on('rateLimited', async (info) => {
const timeLeft = info.timeToReset / 1000;
await this.chat.say(this.settings.debug.logChannel, `@itsjusttriz -> DiscordWebhook for channel (${channel}) has been rate-limited. Time left: ${timeLeft}`);
Also not sure how id be getting rateLimited when the hook is only used for the 1 twitch cmd, which is very rarely used. im not using a bot client. Im literally just using WebhookClient, to send a message from a twitch chat, to a discord channel. Literally just a !reminder command, which takes the text after the cmd, and sends it to a discord channel. how so? Well... its not the ONLY thing, I have the same type of setup for when a channel is raided or someone redeems a Channel Point redemption on Twitch... the log of that event gets sent to a channel in my discord. So from what youre saying... by having the Webhook do what it was intended to do... its been banned from doing it?
Want results from more Discord servers?
Add your server