Skip to content

Add Telegram bot reply-keyboard menus and persistent screenshot settings - #3

Open
HorGonAI wants to merge 1 commit into
horgonai/add-logging-to-save-all-logsfrom
horgonai/add-button-keyboard-functionality-to-bot
Open

Add Telegram bot reply-keyboard menus and persistent screenshot settings#3
HorGonAI wants to merge 1 commit into
horgonai/add-logging-to-save-all-logsfrom
horgonai/add-button-keyboard-functionality-to-bot

Conversation

@HorGonAI

@HorGonAI HorGonAI commented Feb 1, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Restore/provide reply-keyboard (ButtonKeyboard) UI in the Telegram bot so users can navigate menus: main (Скриншот, Настройки), settings → Качество, screenshot submenu → Разрешение, Качество, Сжатие, with Назад navigation and inputs for quality/resolution.
  • Ensure screenshot sending respects compression setting (send as photo or document) and that user settings persist across restarts by saving them back to the config file.

Description

  • Added menu state machine types MenuState and per-chat ChatState, and a chat_states map to track each chat's menu state (file: src/main.cpp).
  • Implemented keyboard JSON helpers escapeJsonString and buildKeyboardJson and reply-send helper sendMessageWithReplyMarkup, plus convenience menu display functions showMainMenu, showSettingsMenu, showQualityMenu, showScreenshotMenu, showResolutionMenu, showQualityInputPrompt (file: src/main.cpp).
  • Added persistent config save helpers saveConfig and joinChatIds, and integrated saving of screenshot settings when changed (file: src/main.cpp).
  • Added sendDocument and updated screenshot delivery logic to send as document when compression is disabled; select sendPhoto when compression is enabled (file: src/main.cpp).
  • Hooked menu navigation and input handling into the main update loop: resolution selection (720,1080,1440), numeric quality input validation (10–100), compression toggle (Сжатие: вкл/выкл), and Назад handling to return to previous menus; settings updates persist to the config file (file: src/main.cpp).

Testing

  • No automated tests were executed for this change.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant