feat(User): banners and accent colors (#6117)

* feat(User): support banners

don't mind it for now, just trying

* feat(User): support banners

* fix(Constants): declare dynamic

* fix(User): eslint

* typings: update User typings

* fix(User): add banner to equals and json bannerURL

* typings: missing dynamic

* refactor: xID to xId

* types: re-add typings

* feat: add banner color and fetch note

* feat: switch to accent color (swap hex and dec))

* Update src/structures/User.js

Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>

* Update typings/index.d.ts

Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Koyamie <koyamie1@gmail.com>
Co-authored-by: Noel <icrawltogo@gmail.com>
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
This commit is contained in:
Advaith
2021-08-24 13:32:18 -07:00
committed by GitHub
parent 96e26c428d
commit 839c6da03d
3 changed files with 66 additions and 5 deletions

View File

@@ -49,8 +49,10 @@ exports.Endpoints = {
if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;
return makeImageUrl(`${root}/avatars/${userId}/${hash}`, { format, size });
},
Banner: (guildId, hash, format = 'webp', size) =>
makeImageUrl(`${root}/banners/${guildId}/${hash}`, { format, size }),
Banner: (id, hash, format = 'webp', size, dynamic = false) => {
if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;
return makeImageUrl(`${root}/banners/${id}/${hash}`, { format, size });
},
Icon: (guildId, hash, format = 'webp', size, dynamic = false) => {
if (dynamic) format = hash.startsWith('a_') ? 'gif' : format;
return makeImageUrl(`${root}/icons/${guildId}/${hash}`, { format, size });