matthew1232 / discord-webhook-node

Allows for easy webhook sending through discord's webhook API
MIT License
95 stars 39 forks source link

Getting an 405 error while trying to send an embed webhook #23

Closed eramsorgr closed 4 years ago

eramsorgr commented 4 years ago

Error sending webhook: 405 status code. Response: {"message": "405: Method Not Allowed", "code": 0}

Code for reference

try {
   const { Webhook, MessageBuilder } = require('discord-webhook-node');
   const hook = new Webhook(`https://discordapp.com/api/webhooks/{numbers}/{numbers}`);
   const embed = new MessageBuilder();
   embed.setTitle('text');
   embed.setColor(299504);
   embed.setDescription('text');
   embed.addField('text', `text`, true);
   embed.addField('text', `text`, true);
   embed.addField(`text`, `text`);
   embed.addField('text', `text`);
   embed.addField('text', `text`);
   embed.setFooter('text');
   embed.setTimestamp();
   await hook.send(embed);
} catch (err) {
   console.error(err);
};
eramsorgr commented 4 years ago

Disregard, something broke on my end, delete this issue