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(MessageEmbed): Deprecate strings for setAuthor() (completely) and setFooter() #7153

Merged
merged 3 commits into from Dec 29, 2021

Conversation

Jiralite
Copy link
Member

@Jiralite Jiralite commented Dec 26, 2021

Please describe the changes this PR makes and why it should be merged:
Due to #7067, setAuthor() and setFooter() should only passing objects and not strings as per the builder's implementation. This pull request deprecates the passing of strings.

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

@ImRodry
Copy link
Contributor

ImRodry commented Dec 26, 2021

Why can't builders be changed to support the current implementation? I think it makes much more sense to do that instead

@vladfrangu
Copy link
Member

I'm not a fan of this required parameters provided 1 after the other with an optional object for optional parameters at all, and I don't know if the others are or aren't on the same page. What is each of those parameters?? You don't know by name, unless you read the docs or hover over the function definition in your editor, whereas with objects you know from the getgo what's what

@ImRodry
Copy link
Contributor

ImRodry commented Dec 27, 2021

VSCode actually introduced a feature recently with TS 4.5 that adds the name of the parameter to the function call so unless you have a variable called text and set that in the text parameter of the footer, it will display as text: “whatever you want” so you can easily know what parameter you’re passing. I think that it makes perfect sense to be able to just pass one string for setAuthor and setFooter because that’s probably what you want most of the time anyway

@kyranet
Copy link
Member

kyranet commented Dec 27, 2021

Yeah, try doing that on a PR review in GitHub or anywhere else that isn't powered by TypeScript.

While you have inlay hints in VSCode (btw, I don't, I didn't enable them yet), you have to consider for the cases where such hints just don't exist, and some people (including me) have to deal with that a lot. Objects are far better in this case because they're named and doesn't depend on inlays or any IDE hints to be properly read and/or understood.

@ImRodry
Copy link
Contributor

ImRodry commented Dec 27, 2021

Well if you’re reviewing a PR you should probably know how the library works to begin with so that shouldn’t be an issue

@vladfrangu
Copy link
Member

That's missing the point that not everyone is using TypeScript, not everyone is using VSCode/IntelliJ, and that in the end an object doesn't cause any harm at all.

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

6 participants