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

Document with_counts param for GET /users/@me/guilds #5628

Merged
merged 3 commits into from Jul 13, 2023

Conversation

JohnyTheCarrot
Copy link
Contributor

I noticed the with_counts query parameter isn't documented for /users/@me/guilds, this PR documents it.

@advaith1
Copy link
Contributor

iirc this is disabled for oauth2 and bots, and only works for user tokens

has that changed?

@JohnyTheCarrot
Copy link
Contributor Author

iirc this is disabled for oauth2 and bots, and only works for user tokens

has that changed?

Well I'm using it in my project right now as we speak so I imagine it has.

@Jupith
Copy link
Contributor

Jupith commented Nov 12, 2022

i remember something about this param needing both guild members read and guilds

@IllagerCaptain
Copy link
Contributor

iirc this is disabled for oauth2 and bots, and only works for user tokens

has that changed?

Just tested with a bot token, worked fine for me.

Comment on lines 49 to 50
| approximate_member_count? | integer | approximate number of members in this guild, returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true` |
| approximate_presence_count? | integer | approximate number of non-offline members in this guild, returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Works on bot tokens too, so I would suggest removing the "(OAuth2)" text from this.

@Jiralite Jiralite mentioned this pull request Mar 30, 2023
@Puncher1
Copy link
Contributor

Puncher1 commented Mar 30, 2023

Can't reproduce with following:

GET /users/@me/guilds

{"with_counts": True}

I get an exception:

400 Bad Request
Your client has issued a malformed or illegal request.

What do I miss? I use a bot token

@Jupith
Copy link
Contributor

Jupith commented Mar 30, 2023

it's a query param, gets don't take body's

@Puncher1
Copy link
Contributor

Puncher1 commented Mar 30, 2023

it's a query param, gets don't take body's

Ah okay. So e.g. /users/@me/guilds?with_counts=true

@IllagerCaptain
Copy link
Contributor

it's a query param, gets don't take body's

Ah okay. So e.g. /users/@me/guilds?with_counts=true

Yep.

docs/resources/Guild.md Outdated Show resolved Hide resolved
@shaydewael shaydewael merged commit ee1de00 into discord:main Jul 13, 2023
2 checks passed
MahdiBM added a commit to DiscordBM/DiscordBM that referenced this pull request Jul 14, 2023
MahdiBM added a commit to DiscordBM/DiscordBM that referenced this pull request Jul 14, 2023
Nihlus added a commit to Remora/Remora.Discord that referenced this pull request Jul 14, 2023
mlnrDev added a commit to disgoorg/disgo that referenced this pull request Jul 16, 2023
lukellmann added a commit to kordlib/kord that referenced this pull request Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants