zaida04 / guilded.js

A library for creating bots with the guilded.gg bot API.
https://guilded.js.org
MIT License
69 stars 15 forks source link

Feature request: add `channel.createWebhook()` function #197

Closed williamhorning closed 1 year ago

williamhorning commented 1 year ago

Is your feature request related to a problem? Please describe. Not really, this would allow us to create webhooks the same was as discord.js.

Describe the solution you'd like In discord.js, there is a channel.createWebhook() function that allows for us to create webhooks in a channel but there isn't an equivalent in guilded.js.

Describe alternatives you've considered Currently, I use the client.rest.router.createWebhook() function to do this, but it's a bit more complex than channel.createWebhook() in discord.js.

Additional context

// This is what needs to be done currently
let a = await client.rest.router.createWebhook(channelId, {
    channelId,
    name: "bridge",
});
// This is what I want to be able to do
let a = await channel.createWebhook({
    name: "bridge",
})
zaida04 commented 1 year ago

Hmmm, I've held off on making channel methods because the Guilded API at most gives a channel ID in payloads, meaning you'd have a channel object with just an ID.

I recommend using client.webhooks.create if the rest router is giving too complex payloads back to you.

williamhorning commented 1 year ago

@zaida04 I guess that makes sense, though I didn't know there was the client.webhooks.create function