This might fix Discord pings not working. AFAIK Discord might have
changed the defaults which might have broken some of our bots.
Bots that want to set flags should explicitly do so. We're not
supporting Discord's defaults.
This commit gets rid of contain-it-all structs and instead opt for
interface union types containing underlying concrete types with no
overloading.
The code is much more verbose by doing this, but the API is much nicer
to use. The only disadvantage in that regard is the interface assertion
being too verbose and risky for users at times.
api.{Send,Edit}MessageData and their equivalents in package api/webhook
have been updated to add some fields added in Discord API v9.
(webhook.Client).EditMessage now also returns a message, because that
endpoint returns a message on success.
This commit moved ExecuteWebhookData from package api to package webhook
inside package api. This change required splitting the multipart
abstractions away from package api, so they are now inside package
sendpart in utils.
This commit will break code that uploads anything, as the type name is
now sendpart.File from api.SendMessageFile. The behavior should be the
same as before.
* Webhook: Add support for message edit and delete
* Webhook: remove global functions
* Webhook: move package Webhook into api/
* Webhook: Moved (unused in API) data struct to package webhook
Co-authored-by: diamondburned <datutbrus@gmail.com>
* API: separate token-based and bot-based interactions with webhooks
* API: move writeMultipart to internal/multipartutil
* Multipartutil: fix double filetype-suffix