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

feat: v8 support #14

Merged
merged 33 commits into from
Oct 4, 2020
Merged

feat: v8 support #14

merged 33 commits into from
Oct 4, 2020

Conversation

zaida04
Copy link
Contributor

@zaida04 zaida04 commented Sep 15, 2020

Accomplishes:

  • copy all files from v6 into a v8 folder
  • update all payloads accordingly

accompanied by the list of v8 changes (applicable ones at least):

  • permissions is now back to the original field, as a string.
  • game fields are now removed, replaced with the first element in activities. For widget endpoint, game field on users is renamed to activity, since there's still a singular field.
  • Channel Permission Overwrites have their type field serialized as a number (e.g. 0) instead of a string (e.g. role)
    embed_enabled and embed_channel_id fields are removed, replaced with corresponding widget_ fields.
  • Form error responses now have a format that is better aligned with "regular errors".
  • Rate limit headers are sending seconds instead of milliseconds now. As such, the X-RateLimit-Precision header is no longer respected.
  • Bots no longer get CHANNEL_CREATE for DMs on v8.
  • Many routes have been deprecated.
  • Bans delete-message-days is no longer available. Use delete_message_days instead.
  • Removed roles, premium_since, and nick from Presence Update gateway event.

@monbrey
Copy link
Member

monbrey commented Sep 15, 2020

This doesn't close #12 yet - are there more commits on the way?

I'm not sure #12 should be closed at all as it looks like it's supposed to be an open TODO list anyway.

@zaida04
Copy link
Contributor Author

zaida04 commented Sep 15, 2020

Oh, I meant when it’s NOT (WIP) it shall close that issue (That is if it’s not a continuous todo list)

@zaida04
Copy link
Contributor Author

zaida04 commented Sep 15, 2020

More commits on the way, welcome to contr. on me fork

@zaida04 zaida04 marked this pull request as draft September 15, 2020 22:03
@vladfrangu
Copy link
Member

Please be aware of the changes in #15! They shouldn't conflict with the current state of this PR, however they should be merged into, then adapted to v8 wherever possible (if _new is dropped in responses, adapt accordingly) 👍

@zaida04
Copy link
Contributor Author

zaida04 commented Sep 19, 2020

Thank u advaith, I appreciate it. Forgive my slowness.

Is that it? Should I undraft it?

@advaith1
Copy link
Contributor

I think that's it but we should still wait for the docs PR next week

@vladfrangu vladfrangu linked an issue Sep 20, 2020 that may be closed by this pull request
@vladfrangu
Copy link
Member

Can you also ensure any "Type"s are accurate? (example: Audit Log overwrite type)

}

export enum AuditLogOptionsType {
Member = 'member',
Copy link
Member

Choose a reason for hiding this comment

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

Are these the same in v8?

Copy link
Contributor

@advaith1 advaith1 Sep 21, 2020

Choose a reason for hiding this comment

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

Oh, I didn't there's another type specifically for audit logs

... it looks like v8 sends those as a number in a string ("1"), I suppose that's a bug, I'll make an issue

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened an issue: discord/discord-api-docs#2088

I guess we should leave this until it gets a reply

not sure why that needs to be a different type though? we could just set it to OverwriteType (if it should be just a number)

Copy link
Member

Choose a reason for hiding this comment

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

If they're the same type.. and only for overwrites, you can delete it from both v6 and v8 and use the OverwriteType enum instead
First tho we have to wait for Discord's reply on the issue

@advaith1
Copy link
Contributor

@advaith1
Copy link
Contributor

advaith1 commented Oct 1, 2020

ok, I think this is done

@zaida04 zaida04 marked this pull request as ready for review October 1, 2020 19:24
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

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

Some small nits

Also, if possible, adding a

@deprecated The types for the v6 version of the API types will not receive further updates. Please update to v8

to each v6 exported interface, objects, or whatnot, to mark that people should move to.. well, v8

v6/payloads/guild.ts Outdated Show resolved Hide resolved
v6/payloads/guild.ts Outdated Show resolved Hide resolved
v6/rest/guild.ts Outdated Show resolved Hide resolved
v6/rest/index.ts Outdated Show resolved Hide resolved
v8/gateway/index.ts Outdated Show resolved Hide resolved
advaith1 and others added 2 commits October 1, 2020 13:01
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
@vladfrangu
Copy link
Member

One last note, other than the requested changes, please also keep in mind of #22 and integrate accordingly 🙏 (which was just merged 👀)

v6/rest/index.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API v8 support
5 participants