I've proxied the URLs with `getProxyUrl` specifying the size as 80x80.
I've also adjusted the event logic so that unstarring doesn't trigger an
alert and I've disabled the 'watch' event because Discord doesn't use
it either.
Validation on embeds has interesting behavior. Embeds have a `timestamp`
property that is of type `Date`. However when providing a Date,
`WebhookExecuteSchema` silently ends the operation.
The resolution was to use strings and to annotate them with `//
@ts-expect-error`. This was not my first choice, but it was the best
option I saw.
The other option is to allow `Embeds` to pass strings as a timestamp but
I'd want a second opinion before making that change.
The GitHub API provides `ref_type` as lowercase. For consistency, this
adds a utility function and makes use of it when formatting the `create`
event from GitHub.
tag => Tag
branch => Branch
I've created a middleware that runs when `/github` is appended to the
webhook URL. The middleware parses the GitHub webhook and turns it into
usable embeds.
The biggest hold-up was missing fields (`premium_tier`,
`welcome_screen`, etc.) but it looks like someone has provided a
helpful function called `createGuild(...)` to provide sensible default
values.
This commit fixes the errors related to creating a guild from a
template. I've also refactored the code to include roles and channels in
the template.
To make sure that the @everyone role is cloned correctly, when
creating the guild from a template, we check if the role's ID
matches the template's `source_guild_id`. If it does, we set the
@everyone role to the new guild's ID.