Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for user banners #1238

Merged
merged 15 commits into from
Oct 5, 2021

Conversation

conorwastakenwastaken
Copy link
Contributor

@conorwastakenwastaken conorwastakenwastaken commented Jul 4, 2021

With banners being released, a lot of people have asked Discord to allow bots to see user banners, and they have confirmed that they will add the banner image hash to the user object in the future. This PR also adds the bannerColor property to the User structure, which is also being exposed to us (if the user sets one)!

Due to the fact that this PR is untestable, and the property is not yet sent to bots, I'll mark it as a draft. This is currently only available in the Canary API.

These changes are documented here.

lib/structures/User.js Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
lib/structures/User.js Show resolved Hide resolved
lib/structures/User.js Outdated Show resolved Hide resolved
@bsian03 bsian03 added the Discord label Jul 6, 2021
@Awoocado
Copy link
Contributor

Those fields are accessible in the canary API and documented in discord/discord-api-docs#3448

@conorwastakenwastaken
Copy link
Contributor Author

Regarding a40c55a, please see this comment.

@conorwastakenwastaken
Copy link
Contributor Author

banner and banner_color are in the stable API now, but it'd probably be best for us to wait until Discord update the API again to fully turn banner_color to int?

@GoldenAngel2
Copy link

It would be best to wait until they update it to int.

DonovanDMC added a commit to DonovanDMC/eris that referenced this pull request Jul 20, 2021
Copy link

@GoldenAngel2 GoldenAngel2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

banner_color has been changed to accent_color

bannerColor -> accentColor

discord/discord-api-docs#3448

banner_color will most likely be removed whenever the old clients switch to accent_color

(also accent_color is the number/int)

lib/gateway/Shard.js Outdated Show resolved Hide resolved
lib/gateway/Shard.js Outdated Show resolved Hide resolved
lib/gateway/Shard.js Outdated Show resolved Hide resolved
lib/gateway/Shard.js Outdated Show resolved Hide resolved
lib/gateway/Shard.js Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
lib/gateway/Shard.js Outdated Show resolved Hide resolved
lib/structures/Member.js Outdated Show resolved Hide resolved
lib/structures/User.js Outdated Show resolved Hide resolved
lib/structures/User.js Outdated Show resolved Hide resolved
@DonovanDMC
Copy link
Contributor

DonovanDMC commented Aug 20, 2021

Is it something with my setup, this pr, or are these not sent via gateway yet? I'm currently fetching the user via rest if the banner/accent_color properties are undefined, and I'm getting them just fine via rest.

(using DonovanDMC/eris @ 5c00439)

@GoldenAngel2
Copy link

It's only available via rest. @DonovanDMC
There's a feature request open to include it in the message author object discord/discord-api-docs#3577

@DonovanDMC
Copy link
Contributor

that's annoying

Copy link
Collaborator

@bsian03 bsian03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see if Discord are planning to change this but for now, make the change to reflect the current behaviour

index.d.ts Outdated Show resolved Hide resolved
commit daedb2b
Author: Donovan Daniels <hewwo@yiff.rocks>
Date:   Thu Sep 2 16:40:24 2021 -0500

    Sticker Sending (abalabahaha#1252)

    Co-Authored-By: Catboy <elijahchristopherjohnson@gmail.com>
    Co-authored-by: bsian03 <chharry321@gmail.com>

commit e357991
Author: 5antos <66580910+5antos@users.noreply.github.com>
Date:   Sun Aug 29 23:18:45 2021 +0100

    Enhancements for VoiceChannel join methods (abalabahaha#1195)

    Co-authored-by: Almeida <almeidx@pm.me>
    Co-authored-by: bsian03 <chharry321@gmail.com>

commit 53da0d5
Author: HeadTriXz <32986761+HeadTriXz@users.noreply.github.com>
Date:   Sat Aug 21 22:47:13 2021 +0200

    Better types for events (abalabahaha#1242)

    Co-authored-by: HeadTriXz <headtrixz@outlook.com>

commit 5246da9
Author: abalabahaha <hi@abal.moe>
Date:   Thu Aug 19 13:08:56 2021 +0000

    Bump dev version

commit 6331536
Author: NeTT <56877379+retraigo@users.noreply.github.com>
Date:   Thu Aug 19 18:29:06 2021 +0530

    Pass user data with member in Message constructor (abalabahaha#1260)

    Prevents "User associated with Member not found"

commit a58cd69
Author: bsian03 <chharry321@gmail.com>
Date:   Thu Aug 19 13:55:33 2021 +0100

    Support per-guild avatars (abalabahaha#1219)

commit 21a3ce5
Author: Erin <erin20913@gmail.com>
Date:   Thu Aug 19 08:40:54 2021 -0400

    Add decodeReasons to typings (abalabahaha#1250)

commit 120f917
Author: bsian03 <chharry321@gmail.com>
Date:   Thu Aug 19 13:05:33 2021 +0100

    Expose components (abalabahaha#1189)

    Co-authored-by: HeadTriXz <32986761+HeadTriXz@users.noreply.github.com>
    Co-authored-by: HeadTriXz <32986761+HeadTriXz@users.noreply.github.com>
    Co-authored-by: Tsumari <lucasflicky@hotmail.com>
    Co-authored-by: Catboi <50190590+Catboi8@users.noreply.github.com>

commit 1e95e62
Author: bsian03 <chharry321@gmail.com>
Date:   Thu Aug 19 12:48:23 2021 +0100

    Warn when invalid intent is supplied (abalabahaha#1261)

commit a7bff54
Author: iiFDCT <35053522+iiFDCT@users.noreply.github.com>
Date:   Thu Aug 19 12:46:51 2021 +0100

    Use new permission, intent names (abalabahaha#1257)

commit c31685e
Author: bsian03 <chharry321@gmail.com>
Date:   Thu Aug 19 12:44:57 2021 +0100

    Improve v8 ratelimit handling (abalabahaha#1256)

commit 1e4d78a
Author: bsian03 <chharry321@gmail.com>
Date:   Thu Aug 19 12:28:14 2021 +0100

    Expose audit log events 83-85 (abalabahaha#1213)

    * Audit log types 83-85

    * Update the comment

commit 840227e
Author: bsian03 <chharry321@gmail.com>
Date:   Thu Aug 19 12:19:02 2021 +0100

    Type guild features as actual values (abalabahaha#1212)

commit 4bb65f0
Author: Emad Abdullah <ea@ea.sa>
Date:   Thu Aug 5 00:04:44 2021 +0300

    fix permissions: Value "undefined" is not int for editRole & createRole (abalabahaha#1249)

commit 756943d
Author: Donovan Daniels <hewwo@yiff.rocks>
Date:   Wed Aug 4 15:58:35 2021 -0500

    Fix documentation for create/editRole (abalabahaha#1248)

commit 3d80d20
Author: Ashesh <3626859+Ashesh3@users.noreply.github.com>
Date:   Wed Aug 4 15:10:37 2021 +0530

    Mark ClientOptions in Eris function as required (abalabahaha#1255)

commit ee960c0
Author: bsian03 <chharry321@gmail.com>
Date:   Tue Jul 13 21:25:57 2021 +0100

    Fix possibly undefined member in voiceStateUpdate (abalabahaha#1217)

    Co-authored-by: Erin <erin20913@gmail.com>

commit e194a71
Author: Khaaz <khaaz.dev@gmail.com>
Date:   Tue Jul 13 13:04:21 2021 +0200

    REST v8, Gateway v8 (abalabahaha#1038)

    Co-authored-by: macdja38 <jakeincanada@icloud.com>
    Co-authored-by: bsian03 <chharry321@gmail.com>
    Co-authored-by: abalabahaha <hi@abal.moe>

commit 0726aae
Author: geg <65479041+gegdev@users.noreply.github.com>
Date:   Tue Jul 13 06:35:08 2021 -0400

    Use embeds array in embed example (abalabahaha#1244)

commit 8e9a2b7
Author: Reinhardt <73813638+NotMarx@users.noreply.github.com>
Date:   Tue Jul 13 17:34:33 2021 +0700

    Support sending multiple embeds (abalabahaha#1239)

commit 7e55222
Author: bsian03 <chharry321@gmail.com>
Date:   Mon Jul 12 18:25:00 2021 +0100

    Allow passing a plain object to permissionsOf (abalabahaha#1224)

    Co-authored by: curtisf <caf203@gmail.com>

commit 0abf61a
Author: bsian03 <chharry321@gmail.com>
Date:   Sun Jul 11 12:14:44 2021 +0100

    Expose Guild#nsfwLevel, deprecate Guild#nsfw (abalabahaha#1207)

commit 11d21c9
Author: Avocado <43632131+Awoocado@users.noreply.github.com>
Date:   Wed Jul 7 02:20:21 2021 -0500

    Update Endpoints.js (abalabahaha#1241)

commit d4a49a6
Author: bsian03 <chharry321@gmail.com>
Date:   Tue Jul 6 23:38:36 2021 +0100

    Document disconnecting members from vc better (abalabahaha#1202)

    * Update Member.js

    * Update Guild.js

    * Update Client.js

    * No idea how that happened

commit b483ff3
Author: iiFDCT <35053522+iiFDCT@users.noreply.github.com>
Date:   Tue Jul 6 16:21:56 2021 +0100

    Update sticker properties (abalabahaha#1237)

    * Use `sticker_items`

    * Docs

    * Update docs

    * Deprecate `stickers`, use `sticker_items`

    * Add user to cache

    * Empty string

    * Use camelCase

    * Wrong func

    * Docs

    * Add back useless property

    * Pretend like this variable ever gets defined

    * Newlines

commit 15546c4
Author: bsian03 <chharry321@gmail.com>
Date:   Mon Jul 5 22:53:50 2021 +0100

    Make purgeChannel use getMessages options (abalabahaha#1236)
@conorwastakenwastaken
Copy link
Contributor Author

Messed up with 8200263 and ef632cf sorry lol

@conorwastakenwastaken conorwastakenwastaken marked this pull request as ready for review September 4, 2021 00:02
index.d.ts Outdated Show resolved Hide resolved
@bsian03 bsian03 merged commit 558bbe5 into abalabahaha:dev Oct 5, 2021
@conorwastakenwastaken conorwastakenwastaken deleted the user-banners branch October 5, 2021 23:54
bsian03 pushed a commit to bsian03/eris that referenced this pull request Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants