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

Type fixes #586

Merged
merged 17 commits into from Dec 6, 2019
Merged

Type fixes #586

merged 17 commits into from Dec 6, 2019

Conversation

DonovanDMC
Copy link
Contributor

@DonovanDMC DonovanDMC commented Dec 2, 2019

The OldChannel object, which is used in the channelUpdate event is missing the nsfw, and type properties, which are present in the jsdoc.

Copy link
Contributor

@Skillz4Killz Skillz4Killz left a comment

Choose a reason for hiding this comment

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

More missing types from oldChannel

index.d.ts Outdated Show resolved Hide resolved
Co-Authored-By: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
@DonovanDMC
Copy link
Contributor Author

if we really wanted to, we could get really specific with the type parameter so only the properties that would be on the specific channel are there, though that would probably be done in the event definition instead.

@Skillz4Killz
Copy link
Contributor

@DonovanDMC Silly question, but how does one even change the channel type? Is that even possible? I didn't know discord supported that.

@DonovanDMC
Copy link
Contributor Author

DonovanDMC commented Dec 2, 2019

@DonovanDMC Silly question, but how does one even change the channel type? Is that even possible? I didn't know discord supported that.

I don't think you can change the type of channels.

@Skillz4Killz
Copy link
Contributor

Then i think the best way to handle this would be to remove the type property from OldMessage and the typings. type can never change.

index.d.ts Outdated Show resolved Hide resolved
@Zoddo
Copy link
Contributor

Zoddo commented Dec 2, 2019

A text channel can be converted to a news channel and vice versa.

@DonovanDMC
Copy link
Contributor Author

A text channel can be converted to a news channel and vice versa.

True, forgot about that.

@Skillz4Killz
Copy link
Contributor

Ahh very good point so we do need the type property on the oldChannel incase the text-news types change.

They were optional, due to the channel parameter being `AnyChannel`, but it's `AnyGuildChannel` now, therefore they will be there.
@DonovanDMC
Copy link
Contributor Author

Decided to convert the types back to just OldChannel, because it's much cleaner, and a lot less of a mess since nothing else is working. As well made some changes to guildRoleUpdate, as it was missing properties, and they were all optional since they were using RoleOptions.

index.d.ts Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
DonovanDMC and others added 2 commits December 3, 2019 10:48
Co-Authored-By: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
Skillz4Killz
Skillz4Killz previously approved these changes Dec 3, 2019
@DonovanDMC DonovanDMC changed the title OldChannel is missing nsfw & type Type fixes Dec 3, 2019
@abalabahaha abalabahaha merged commit cb62e78 into abalabahaha:dev Dec 6, 2019
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

5 participants