Git Product home page Git Product logo

Comments (2)

araikphp avatar araikphp commented on June 2, 2024

I completely agree with your perspective. It's quite logical to expect that if you're adding a keyboard to a command, the callback triggered by that command's button should intuitively direct back to the same command. The lack of clear documentation or guidance on executing a command like $this->getTelegram()->executeCommand('command') upon pressing a button is indeed a significant oversight. It's a step that naturally extends the functionality of inline keyboards and should be addressed in the documentation or examples provided. Your effort to shed light on this issue is valuable, and hopefully, it will prompt an enhancement in the resources available to developers.

from core.

Hitmare avatar Hitmare commented on June 2, 2024

The way Telegram sends interactions with InlineButtons is through Callbackqueries.

To start a command or any function that is not implemented by Telegram like URL, Web App, Login URL and such is done by sending a callback_data InlineKeyboard API Funciton

The callback_data is send back to the bot and can be handled by the CallbackQueryCommand.php Command file, found in the example-bot

there you can access the callback_data and use functions like switch or if to check if the callback_data contains a certain value to then trigger the $this->getTelegram()->executeCommand('command') function

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.