Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Update Class to Support Command Extraction from "callback_query" #1135

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from

Commits on Aug 9, 2024

  1. Refactor Command class to improve handling of updates:

    - Replaced `getUpdate()->getMessage()->text` with `getUpdate()->getText()` to simplify text retrieval.
    - Improved `relevantMessageSubString` method to better handle different message formats and avoid potential errors.
    miladkhodaverdi23 committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    2899b43 View commit details
    Browse the repository at this point in the history
  2. Add support for callback queries in CommandBus

    - Updated `handler` method to handle `callback_query` updates.
    - Implemented command parsing for callback queries with format `/callback:::\w*`.
    - Maintained existing command parsing and execution for regular messages.
    - Ensured backward compatibility with previous command handling logic.
    miladkhodaverdi23 committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    cdf4d30 View commit details
    Browse the repository at this point in the history
  3. feat: Add getText method to Update class for extracting text

    - Implemented `getText` method to retrieve text from various update types:
      - Returns message text for 'message', 'edited_message', 'channel_post', and 'edited_channel_post' types.
      - Returns formatted callback query data for 'callback_query' type.
      - Returns empty string for other types.
    - Updated docblocks to reflect the new method.
    - Maintained backward compatibility with deprecated methods.
    miladkhodaverdi23 committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    49aeec3 View commit details
    Browse the repository at this point in the history