From f10df31f5c9b99300a54a1c45d45269a96a16a92 Mon Sep 17 00:00:00 2001 From: Umimaso Date: Sat, 19 Jun 2021 14:50:11 +0100 Subject: 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 --- cache/widget/banner1.png | Bin 0 -> 5950 bytes cache/widget/banner2.png | Bin 0 -> 3756 bytes cache/widget/banner3.png | Bin 0 -> 5342 bytes cache/widget/banner4.png | Bin 0 -> 13105 bytes cache/widget/shield.png | Bin 0 -> 726 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 cache/widget/banner1.png create mode 100644 cache/widget/banner2.png create mode 100644 cache/widget/banner3.png create mode 100644 cache/widget/banner4.png create mode 100644 cache/widget/shield.png (limited to 'cache') diff --git a/cache/widget/banner1.png b/cache/widget/banner1.png new file mode 100644 index 00000000..ed9bd5c0 Binary files /dev/null and b/cache/widget/banner1.png differ diff --git a/cache/widget/banner2.png b/cache/widget/banner2.png new file mode 100644 index 00000000..90d3713d Binary files /dev/null and b/cache/widget/banner2.png differ diff --git a/cache/widget/banner3.png b/cache/widget/banner3.png new file mode 100644 index 00000000..22351898 Binary files /dev/null and b/cache/widget/banner3.png differ diff --git a/cache/widget/banner4.png b/cache/widget/banner4.png new file mode 100644 index 00000000..e6bd7b6f Binary files /dev/null and b/cache/widget/banner4.png differ diff --git a/cache/widget/shield.png b/cache/widget/shield.png new file mode 100644 index 00000000..30277db2 Binary files /dev/null and b/cache/widget/shield.png differ -- cgit 1.5.1