browse.py print_browse() and send_to_telegram() too long #14

Closed
opened 2026-03-25 10:47:42 +01:00 by shoko · 0 comments
Owner

Description

The print_browse() and send_to_telegram() functions in skills/polymarket-browse/scripts/browse.py are too long and contain a lot of inline code for formatting and displaying events.

  • print_browse() (lines 474-549): ~75 lines
  • send_to_telegram() (lines 579-709): ~130 lines

Both functions duplicate a lot of logic for formatting match/non-match events, which makes the code harder to maintain and extend.

Proposed Solution

Extract the inline formatting logic into smaller helper functions, for example:

  • format_match_event_line() / format_non_match_event_line()
  • build_match_section() / build_non_match_section()

This would reduce duplication and improve maintainability.

Alternatives Considered

Keep the functions as-is, but this leads to code duplication and harder maintenance as new event types or formatting rules are added.

## Description The `print_browse()` and `send_to_telegram()` functions in `skills/polymarket-browse/scripts/browse.py` are too long and contain a lot of inline code for formatting and displaying events. - `print_browse()` (lines 474-549): ~75 lines - `send_to_telegram()` (lines 579-709): ~130 lines Both functions duplicate a lot of logic for formatting match/non-match events, which makes the code harder to maintain and extend. ## Proposed Solution Extract the inline formatting logic into smaller helper functions, for example: - `format_match_event_line()` / `format_non_match_event_line()` - `build_match_section()` / `build_non_match_section()` This would reduce duplication and improve maintainability. ## Alternatives Considered Keep the functions as-is, but this leads to code duplication and harder maintenance as new event types or formatting rules are added.
shoko added the enhancement label 2026-03-25 10:47:57 +01:00
shoko added the medium label 2026-03-25 13:28:28 +01:00
shoko closed this issue 2026-03-25 20:11:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jujutsu-skills#14