Discord API responded with code 400
TenayaMasai

Hi

The mod worked a couple days ago and out of no where i keep getting [Notify On Keyword] Discord API responded with code 400.

Ive used different webhooks but nothing seems to work :(

MikeHawke
I'm getting the same issue, also the same with Notify on discord.  Guessing discord have changed something

Merged post

Looks like the Discord API has changed:

[DiscordMessages] Failed! Discord responded with code: 400. Plugin: Unknown Plugin {"message": "Cannot send an empty message", "code": 50006}

[Notify On Keyword] Discord API responded with code 400.

[DiscordMessages] Failed! Discord responded with code: 400. Plugin: DiscordMessages {"message": "Cannot send an empty message", "code": 50006}

Wulf
uMod Admin
The Discord Messages plugin is already fixed, but this issue is something the Discord API plugin would have to fix as well.
MikeHawke
Why has this been marked as not an issue? The code still needs to be updated to be able to be compatible with the API changes so there is still an issue... I only posted Notify On Keywords error sandwiched between Discord Messages error to show that it is an issue with communicating with the API... the issue has not been resolved just because you tell me a different plugin is fixed.
Wulf
uMod Admin
5d72c049357bb.png MikeHawke
Why has this been marked as not an issue? The code still needs to be updated to be able to be compatible with the API changes so there is still an issue... I only posted Notify On Keywords error sandwiched between Discord Messages error to show that it is an issue with communicating with the API... the issue has not been resolved just because you tell me a different plugin is fixed.
It was a mistake, was thinking this plugin used another plugin called "Discord API."
MikeHawke
Okay so mine has started working again... looks like Discord have reversed some changes ... but probably still worth updating for the future :P
TenayaMasai
Original Poster
mine still the same. no change :(
mic92
mines broken to on all 3 servers
;{
TenayaMasai
Original Poster
anyone been able to get this to work?
mic92
Nope still the same
MikeHawke
@wulf any chance of giving buzz a nudge, hes not been on for 3 months and I miss this plugin :(

Merged post

From what I've read the Content type request header cannot be blank anymore it was a bug and security issue and now it needs to be application/json. How you implement that I don't know but I'm trying and failing misserably :D

Merged post

GOT IT!!!
added:

private readonly Dictionary<string, string> _content = new Dictionary<string, string>
        {
            ["Content-Type"] = "application/json"
        };

Just before

private void LoadVariables()

and changed 
}, this, RequestMethod.POST);​
tooooooo
}, this, RequestMethod.POST, _content);​


TenayaMasai
Original Poster
Thanks for that. Im a huge noob. Possible to add a pastebin or something. I cant get it right adding your solution :(
MikeHawke
well it was working but the chathook has been changed and now im lost again

Merged post

and now the plugin is unclaimed.... wulf.... could you help out mate. 

This is where we are at but I don't know enough to set it up with the new hook.

Wulf
uMod Admin
I'll take a look at updating the plugin if nobody else claims it.
MikeHawke
cheers buddy.... got the discord bit sorted.... just need to figure out the chat hook. Gutted as I just got it working again this morning.