Comments (2)
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.
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)
- Using static methods is bad idea HOT 5
- Unable to add a command that handles web_app_data HOT 3
- Bot API 6.9
- Can't have more than 1 class for generics messages HOT 1
- Bot so slow work...
- getUpdates Fatal error when no connection
- How to send message outside webhooks? HOT 1
- sendDocument doesn't have option to specify only file_id as String to send a file that exists on the Telegram servers HOT 2
- Need help basic flow getUpdates HOT 2
- /chats * with multiple bots HOT 1
- Chat boost
- LoginUrl and Page Security
- MessageOrigin
- forward inline_keyboard with data to command HOT 3
- Bot API 7.0
- Parallel commands HOT 7
- "PHP Deprecated: ... " HOT 3
- Provide further variables to *all* commands.
- Fix PHP Error - Call to a member function getChat() on null
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.