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

refactor(interactions): use the new channel field #63

Merged
merged 2 commits into from
Apr 11, 2023

Conversation

TTtie
Copy link
Member

@TTtie TTtie commented Apr 8, 2023

@TTtie TTtie added type: enhancement New feature or request reason: Discord Issues or pull requests related to Discord's API changes labels Apr 8, 2023
@TTtie TTtie added this to the 0.2.0 milestone Apr 8, 2023
@TTtie TTtie self-assigned this Apr 8, 2023
@TTtie TTtie force-pushed the feat/interaction-channel-field branch from f4dee7a to 31cb6cb Compare April 9, 2023 20:22
index.d.ts Outdated
@@ -69,6 +69,7 @@ declare namespace Dysnomia {
type GuildTextableChannel = TextChannel | TextVoiceChannel | NewsChannel | StageChannel;
type GuildTextableWithThreads = GuildTextableChannel | AnyThreadChannel;
type InviteChannel = InvitePartialChannel | Exclude<AnyGuildChannel, CategoryChannel | AnyThreadChannel>;
type PossiblyUncachedInteractionChannel = Textable | { id: string; type: ChannelTypes };
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use Pick<Channel, 'id' | 'type'>?

or use a new interface on line 63?
interface UncachedChannel extends Uncached { type: ChannelTypes }

Copy link
Contributor

Choose a reason for hiding this comment

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

Textable also doesn't have any channel related properties, is there a better type we can use?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe TextableChannel | PartialChannel would be a better choice?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I agree.

Also, type in PartialChannel is a number instead of ChannelTypes. Something to update here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely something to tackle (in a different PR)

@TTtie TTtie merged commit c865122 into dev Apr 11, 2023
@TTtie TTtie deleted the feat/interaction-channel-field branch April 11, 2023 07:37
TTtie added a commit that referenced this pull request Apr 14, 2023
* refactor(interactions): use the new `channel` field

Ref: discord/discord-api-docs@88a7618

* use a better type for PossiblyUncachedInteractionChannel
TTtie added a commit that referenced this pull request May 11, 2023
* refactor(interactions): use the new `channel` field

Ref: discord/discord-api-docs@88a7618

* use a better type for PossiblyUncachedInteractionChannel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reason: Discord Issues or pull requests related to Discord's API changes type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants