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(Embed): remove add field #7522
Conversation
I think this method should be changed to match v13’s MessageEmbed#addField instead because it is quite useless as it is right now. I don’t think removing it is the way to go because there are many situations where you may only need one field and creating the object just adds unnecessary visual burden to the code |
I think the method should stay as is, although I can see how it's redundant compared to |
i think it's nicer if d.js is ugly so that downstream code can look clean. addFields([field]) just to make the method happy, is kind of a tragedy. i'd personally rather recommend people spread into addField than the above mess |
That's not how the spread arguments work, you don't need to wrap them in brackets |
i didn't say they need to be in brackets? |
why just remove addField and not other builder methods like addChoice an such? |
the methods exclusively take a rest parameter since #7395 |
ah, thanks. then yeah, such a little stub passthrough function like addField seems unnecessary |
If this goes through they should be removed. |
you are forgetting why the change was made |
That argument makes no sense because fields are composed of 2 required parameters and 1 optional one |
i never said this particular one does, but i did give you an example didn't i? |
The example you gave is invalid because it comes from a situation with many optional parameters, which this one isn’t and you’d never be passing undefined for the first or second values because that would be an error |
If the goal is to remove redundancy then imo addFields should be removed instead of addField, which is probably used a lot more. |
Semantically, |
Considering what's used more it's kinda hard to tell I wouldn't say for certain that one is used a lot more than the other. However, grammatically it makes more sense for it be plural since it accepts a rest parameter which is 1..n. |
Breaking Change: Removed singular methods. Breaking Change: ExtraRowPosition is an enum now. More infos in discordjs/discord.js#7522 and discordjs/discord.js#7874
Breaking Change: Removed singular methods. Breaking Change: ExtraRowPosition is an enum now. More infos in discordjs/discord.js#7522 and discordjs/discord.js#7874
Breaking Change: Removed singular methods. Breaking Change: ExtraRowPosition is an enum now. More infos in discordjs/discord.js#7522 and discordjs/discord.js#7874
Please describe the changes this PR makes and why it should be merged:
This PR removes
Embed#addField
in favour ofEmbed#addFields
because you are just saving as
when usingaddField
.Status and versioning classification:
For those who don't wanna replace all
addField
manually can try this regex replace. You can ofc make a better one but using these 2 also works fine. Idk how can I use condition in replace string else it can be simplified to one regex using?
after inline.cross verify before replacing.