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 Guild to TokenRequestResult #108

Merged
merged 3 commits into from
Dec 15, 2024
Merged

Conversation

Markus-Rost
Copy link
Contributor

TokenRequestResult can include a full Guild object when using the bot scope: https://canary.discord.com/developers/docs/topics/oauth2#advanced-bot-authorization-extended-bot-authorization-access-token-example

Might be useful to look into discordjs/discord-api-types to export the types.

@reboxer
Copy link
Owner

reboxer commented Jul 19, 2024

Hey, thanks for the pull request, sorry for taking so long.

I've found that some fields returned by the API don't have types for them (could be that they didn't exist at the time of you creating this PR).

For the guild types, i've found these are missing:

    hub_type
    premium_progress_bar_enabled
    latest_onboarding_question_id
    incidents_data
    inventory_settings
    nsfw
    nsfw_level
    region
    stickers
    home_header

For the role type, only this one is missing:

    description

And we are missing the types for stickers, should look something like this:

  stickers: [
    {
      id: '1263717173604384789',
      name: 'cat',
      tags: '🐱',
      type: 2,
      format_type: 1,
      description: '',
      asset: '',
      available: true,
      guild_id: '816025165212549141'
    }
  ]

I'd really appreciate it if you could update the PR to include these missing types, and in case we missed something, they can be added in the future, thanks.

@Markus-Rost
Copy link
Contributor Author

Guild.home_header, Guild.hub_type, Guild.latest_onboarding_question_id, Guild.incidents_data, Guild.inventory_settings and Role.description are not documented on the developer portal and always returned null for me, I didn't add them as well as deprecated keys. I did add Guild.nsfw despite being undocumented though.

@reboxer reboxer merged commit a57e476 into reboxer:master Dec 15, 2024
1 check passed
@Markus-Rost Markus-Rost deleted the patch-3 branch December 15, 2024 03:58
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.

2 participants