Closed carafelix closed 5 months ago
Attention: Patch coverage is 71.42857%
with 12 lines
in your changes are missing coverage. Please review.
Project coverage is 79.88%. Comparing base (
63bc0fa
) to head (2c2934f
). Report is 2 commits behind head on main.:exclamation: Current head 2c2934f differs from pull request most recent head 74a2f5a
Please upload reports for the commit 74a2f5a to get more accurate results.
Files | Patch % | Lines |
---|---|---|
src/context.ts | 65.71% | 12 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
If the merge commands function is not to clear on what it's doing, just let me know, I can refactor it and can add it as a commands method
Removed pollution from commit history
Test added for merging
Is something missing for this to be merge? I can work on #16 if you think its appropriated
GitHub won't let me merge for some reason and I haven't had the time to do a local merge.
Could you try do rebase this branch on the main branch of the official repo and do a push --force-with-lease
, please?
Now it should be good. Merging main into this branch resulted in duplicate commits, since I merged the fixLocalization branch into this one before. Got a little messy along the way, but it's clean and okay now. (I re-checked that it's working on the telegram client)
Summary
14 is built into this pr (please check that out first)
setMyCommands
function to be able to mergeSetMyCommandsParams
from two or more different sources, based on the fact thattoSingleScopeArgs
group them by language. Merge function its basically a reducer that concatlang.commands
arrays of the same language and returns an array ofsetMyCommandsParams
. It does not break scoping since it's performed after thetoSingleScopeArgs
function. If an empty array is passed, it does not throw, if only one Commands instance is passed it treats it ok.result
variable might be better to change it toacc_Array
or something in those linesPD: I closed the other PR since it was a little messy on the branch managment end, this one is ok. PD2: I can refactor this into a MixedCommands class that extends the Commands Class if that suits more the style. Another way would be to add this as a method to the Commands Class, but I don't know good of an idea would be to mix them before
toSingleScopeArgs
in a method likecommands.mergeWith(otherCommands)
because it would effectively duplicate commands registration if someone use it on let say commands A and B, and register both intobot.use
, registering all at once on A (B was merged into A), and then re-register B commands. Even in that case they would simply overwrite themselves I think so, no?eg:
snippet from the gif (localization in the admin command... 🥴)