DiscordWebhookAPI icon indicating copy to clipboard operation
DiscordWebhookAPI copied to clipboard

Support forum threads

Open Jay2k1 opened this issue 2 years ago • 1 comments

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.

Jay2k1 avatar Feb 11 '23 15:02 Jay2k1

json_string is not defined in this include. Could you provde a test plugin with these function ?

Rushaway avatar Oct 01 '23 16:10 Rushaway