(feat) implement action payload handling for bot commands#66
Open
isreallee82 wants to merge 2 commits into
Open
(feat) implement action payload handling for bot commands#66isreallee82 wants to merge 2 commits into
isreallee82 wants to merge 2 commits into
Conversation
Contributor
|
Author
|
@rapcmia okay let me debug hummingbot-api will get back to you on this |
Author
|
fixed Telegram config-list buttons failed with 400 Bad Request when config IDs became too long, especially HIP-3 IDs containing namespaced pairs like xyz:XYZ100-USD. fixed Hyperliquid HIP-3 pair validation did not recognize natural aliases like xyz:XYZ100. |
Author
|
@rapcmia, also there is issue with Mac OS intel based deployment if not fixed already. I can create a separate pr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This pull request refactors the handling of bot callback actions related to trading pair selection in the
handlers/bots/__init__.pyfile. The main improvement is the introduction of a helper function and a mapping to streamline and centralize handler dispatch for actions that include a payload (such as trading pair selection), reducing code duplication and improving maintainability.Key refactoring and handler dispatch improvements:
Centralized handler dispatch for pair selection:
_split_action_payloadhelper function to consistently parse actions with payloads separated by a colon, returning the main action and its payload._PAIR_PAYLOAD_HANDLERSdictionary to map specific pair-related actions (likepv1_pair,gs_pair,pmm_pair, and their_selectvariants) to their corresponding handler functions.bots_callback_handlerto use the new mapping and parsing logic, calling the appropriate handler with the payload and removing the previous repetitiveelifblocks for these actions.General callback parsing improvements:
select_imageaction to use the new payload parsing logic for greater consistency and reliability, especially for image tags containing colons.These changes make the callback handler code more concise, easier to maintain, and less error-prone by consolidating similar logic and reducing code duplication.