feat: add widget endpoints
Implemented the four widget related endpoints of the api. Partial user object being returned as part of the widget.json endpoint [1] is an intentional choice related to privacy [2]. The widget.json endpoint will require additional changes upon completion of other work. Member details will need to return extra key/values for connected users to voice channels. An additional avatar_url value will hold an unique avatar url for the user + guild, fetched via a CDN endpoint widget-avatars. New dependencies `canvas` and `image-size`. Canvas is used to create the widget.png endpoint image [3]. Image-size is used to set the canvas' size to match the widget template images. Use regex in determining if a NO_AUTHORIZATION_ROUTES is hit or not. [1] https://discord.com/developers/docs/resources/guild#get-guild-widget [2] https://github.com/discord/discord-api-docs/issues/1287 [3] https://discord.com/developers/docs/resources/guild#get-guild-widget-image Closes: #9, #110
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
CDN_HOST: "//localhost:3003",
|
||||
ASSET_ENDPOINT: "",
|
||||
MEDIA_PROXY_ENDPOINT: "https://media.discordapp.net",
|
||||
WIDGET_ENDPOINT: "//discord.com/widget",
|
||||
WIDGET_ENDPOINT: "//localhost:3001/widget",
|
||||
INVITE_HOST: "discord.gg",
|
||||
GUILD_TEMPLATE_HOST: "discord.new",
|
||||
GIFT_CODE_HOST: "discord.gift",
|
||||
|
||||
Reference in New Issue
Block a user