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

docs(ChannelManager): fetch can return Promise<null> #5422

Merged
merged 1 commit into from
Mar 28, 2021

Conversation

advaith1
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
ChannelManager#fetch can return Promise<null> but is only documented to return Promise<Channel>, this PR fixes the docs and typings.

fetch:

return this.add(data, null, cache);

add:

if (!channel) {
this.client.emit(Events.DEBUG, `Failed to find guild, or unknown type for channel ${data.id} ${data.type}`);
return null;
}

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
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@iCrawl iCrawl merged commit 1c8b109 into discordjs:master Mar 28, 2021
@advaith1 advaith1 deleted the channels-fetch-null branch March 28, 2021 21:35
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
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