Skip to content

(feat) implement action payload handling for bot commands#66

Open
isreallee82 wants to merge 2 commits into
hummingbot:mainfrom
isreallee82:development
Open

(feat) implement action payload handling for bot commands#66
isreallee82 wants to merge 2 commits into
hummingbot:mainfrom
isreallee82:development

Conversation

@isreallee82
Copy link
Copy Markdown

This pull request refactors the handling of bot callback actions related to trading pair selection in the handlers/bots/__init__.py file. 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:

  • Introduced the _split_action_payload helper function to consistently parse actions with payloads separated by a colon, returning the main action and its payload.
  • Added the _PAIR_PAYLOAD_HANDLERS dictionary to map specific pair-related actions (like pv1_pair, gs_pair, pmm_pair, and their _select variants) to their corresponding handler functions.
  • Updated bots_callback_handler to use the new mapping and parsing logic, calling the appropriate handler with the payload and removing the previous repetitive elif blocks for these actions.

General callback parsing improvements:

  • Refactored the select_image action 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.

@rapcmia
Copy link
Copy Markdown
Contributor

rapcmia commented Apr 22, 2026

@isreallee82
Copy link
Copy Markdown
Author

@rapcmia okay let me debug hummingbot-api will get back to you on this

@isreallee82
Copy link
Copy Markdown
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.

@isreallee82
Copy link
Copy Markdown
Author

isreallee82 commented Apr 23, 2026

@rapcmia, also there is issue with Mac OS intel based deployment if not fixed already. I can create a separate pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants