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

fix(GuildAuditLogsEntry): replace OverwriteType with AuditLogOptionsType #8345

Merged
merged 3 commits into from Jul 24, 2022
Merged

Conversation

thehairy
Copy link
Contributor

@thehairy thehairy commented Jul 24, 2022

Please describe the changes this PR makes and why it should be merged:

  • This PR fixes a bug with GuildAuditLogsEntry.extra, since the overwrite type is a string and the wrong enum was used.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@vercel
Copy link

vercel bot commented Jul 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
discord-js ✅ Ready (Inspect) Visit Preview Jul 24, 2022 at 1:56AM (UTC)

@vercel vercel bot temporarily deployed to Preview July 24, 2022 01:13 Inactive
@thehairy thehairy closed this Jul 24, 2022
@Jiralite Jiralite added this to the discord.js v14.1 milestone Jul 24, 2022
@thehairy thehairy changed the title fix(GuildAuditLogsEntry): parse data.options.type to number fix(GuildAuditLogsEntry): replace OverwriteType with AuditLogOptionsType Jul 24, 2022
@thehairy thehairy reopened this Jul 24, 2022
@vercel vercel bot temporarily deployed to Preview July 24, 2022 01:56 Inactive
Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

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

The types need to be updated in GuildAuditLogsEntryExtraField:

[AuditLogEvent.ChannelOverwriteCreate]:
| Role
| GuildMember
| { id: Snowflake; name: string; type: 'Role' }
| { id: Snowflake; type: 'Member' };
[AuditLogEvent.ChannelOverwriteUpdate]:
| Role
| GuildMember
| { id: Snowflake; name: string; type: 'Role' }
| { id: Snowflake; type: 'Member' };
[AuditLogEvent.ChannelOverwriteDelete]:
| Role
| GuildMember
| { id: Snowflake; name: string; type: OverwriteType.Role }
| { id: Snowflake; type: OverwriteType.Member };

It seems the first two events still use the string variant and the third event uses OverwriteType instead of AuditLogOptionsType.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants