DiscordWebhookAPI
DiscordWebhookAPI copied to clipboard
Support forum threads
According to the docs, in order to create a forum thread, you only have to supply an additional thread_name field in the JSON (and use a forum channel webhook URL).
I have tried it by just adding a getter and a setter for it in webhook.inc like so:
public bool GetThreadName(char[] buffer, int maxlength) {
return this.GetDataString("thread_name", buffer, maxlength);
}
public void SetThreadName(char[] threadName) {
this.UpdateDataObject("thread_name", json_string(threadName));
}
This worked fine to create a thread. I have not tried using the new code on a regular channel webhook though.
BTW, I found out that the thread_name has a maximum length of 100 characters. If you supply a longer title, it gets truncated.
json_string is not defined in this include. Could you provde a test plugin with these function ?