zaida04/guilded.js

Allow for user-supplied webhook body

williamhorning opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
This isn't related to a problem. I'd like to be able supply a webhook body directly to the WebhookClient.send function in guilded.js

Describe the solution you'd like
I'd like it if the WebhookClient.send function would accept both a webhook body while still allowing for the current system with multiple arguments to be used

Describe alternatives you've considered
I've considered creating my own function to destruct an object and pass it to the WebhookClient.send function.

Additional context
This would be pretty useful for my bot, which uses Webhooks to bridge different chat apps.

Could you elaborate on what you mean by webhook body, or the desired usage? The signature for WebhookClient#send is send(content: string, embeds?: Embed).

Hey there @zaida04, by webhook body I'm referring to what you would send as the body of a POST request when sending to a webhook. I want to be able to provide that directly to guilded.js in a similar way to discord.js's WebhookClient:

let hook = new WebhookClient({id: "123", token: "abc"});

await hook.send({
	content: "hello webhook",
	embeds: [
		{
			description: "webhook embed",
		},
	],
});