Webhook is not working or too long to send messages.

Sometimes I get errors like 'DiscordAPIError[50027]'
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
! Murali Anand
! Murali AnandOP2y ago
const text = interaction.options.getString(`text`);

const channel = client.channels.cache.get(chan_id);
const webhooks = await channel.fetchWebhooks();
const webhook = webhooks.find(wh => wh.token);
if (!webhook) {
const ReplyEmbed = new EmbedBuilder()
.setColor("Green")
.setDescription('No webhook was found that I can use!')

return interaction.reply({
embeds: [ReplyEmbed],
ephemeral: true
});
}

await webhook.send({
content: text,
username: 'Anonymous User',
avatarURL: 'https://icons.veryicon.com/png/o/miscellaneous/xdh-font-graphics-library/anonymous-user.png',
});

const ReplyEmbed = new EmbedBuilder()
.setColor("Green")
.setDescription("Done!")
await interaction.reply({
embeds: [ReplyEmbed],
ephemeral: true
});
const text = interaction.options.getString(`text`);

const channel = client.channels.cache.get(chan_id);
const webhooks = await channel.fetchWebhooks();
const webhook = webhooks.find(wh => wh.token);
if (!webhook) {
const ReplyEmbed = new EmbedBuilder()
.setColor("Green")
.setDescription('No webhook was found that I can use!')

return interaction.reply({
embeds: [ReplyEmbed],
ephemeral: true
});
}

await webhook.send({
content: text,
username: 'Anonymous User',
avatarURL: 'https://icons.veryicon.com/png/o/miscellaneous/xdh-font-graphics-library/anonymous-user.png',
});

const ReplyEmbed = new EmbedBuilder()
.setColor("Green")
.setDescription("Done!")
await interaction.reply({
embeds: [ReplyEmbed],
ephemeral: true
});
its taking too long to send a message using webhook
Want results from more Discord servers?
Add your server