disgoorg / disgo

A modular Golang Discord API Wrapper
Apache License 2.0
335 stars 38 forks source link

Allow the changing of the wait parameter when sending a webhook message #388

Open SkyzerFlyzer opened 2 months ago

SkyzerFlyzer commented 2 months ago

Is your feature request related to a problem? Please describe. As the default behaviour of the api is to not wait when you send a message to a webhook it should at least be an option within this library. Currently wait is always set to true and results in code executing for longer than needed for functions that don't need the message object returned. (This is bad for serverless discord bots)

Describe the solution you'd like I would like the ability to set the wait parameter in the API request, likely via the function call with a parameter called wait

Describe alternatives you've considered There are two alternatives, use a different library or fork this one and change the hard coded value from true to false

Additional context Issue originates from the wait value passed on line 96 in the webhook_client_impl.go file always being true. This would need to be updated to acceoted a passed down variable

topi314 commented 2 months ago

this is already possible

var client webhook.Client
client.Rest().CreateWebhookMessage(client.ID(), client.Token(), discord.WebhookMessageCreate{Content: "Hello, World!"}, false, 0)

we could add a new method to the client directly but it's not really needed imo