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(MessagePayload): Correct return type of resolveFile() #6605

Merged
merged 1 commit into from
Sep 8, 2021
Merged

docs(MessagePayload): Correct return type of resolveFile() #6605

merged 1 commit into from
Sep 8, 2021

Conversation

Jiralite
Copy link
Member

@Jiralite Jiralite commented Sep 7, 2021

Please describe the changes this PR makes and why it should be merged:
Resolves #6604 by correcting the @returns documentation.

Status and versioning classification:

  • This PR only includes non-code changes, like changes to documentation, README, etc.

@NotSugden
Copy link
Contributor

perhaps its also an idea to correct the typings

public static resolveFile(fileLike: BufferResolvable | Stream | FileOptions | MessageAttachment): Promise<unknown>;

why was it ever even unknown?

@Jiralite
Copy link
Member Author

Jiralite commented Sep 7, 2021

I didn't see an interface or type for this actually. files is also typed as unknown[] | null... Isn't the correct type for this HTTPAttachmentData?

discord.js/typings/index.d.ts

Lines 3984 to 3988 in f57791c

export interface HTTPAttachmentData {
attachment: string | Buffer | Stream;
name: string;
file: Buffer | Stream;
}

@kyranet kyranet requested review from iCrawl and vladfrangu September 7, 2021 15:09
@kyranet kyranet added this to the Version 13.2 milestone Sep 7, 2021
@kyranet
Copy link
Member

kyranet commented Sep 7, 2021

We can correct the typings in another PR 👍

@Jiralite
Copy link
Member Author

Jiralite commented Sep 7, 2021

We can correct the typings in another PR 👍

Understood! I have just opened #6608.

@iCrawl iCrawl merged commit ea6a57e into discordjs:main Sep 8, 2021
@Jiralite Jiralite deleted the patch-1 branch September 8, 2021 13:30
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.

Bug: Docs for MessagePayload.resolveFile do not mention it as a Promise return type
5 participants