Comments (6)
Well, there are many ways.
Let's say you have 2 different keyboards, one shows the options A and B and the other one Back and C.
We call the first keyboard ONE and the second TWO.
So when you send the keyboard ONE you write 1 on the database. You send other stuff to the user and finally send the keyboard TWO. Now you write TWO on the database. When the user click Back, check the db, you'll find TWO and you know that the keyboard to show from TWO is ONE.
Pseudo:
if (user_choosed_button() == "Back") {
$prev_key = take_previuos_keyboard_from_db();
if ($prev_key == "TWO") {
sendKeyboardONE();
}
if ($prev_key == "THREE") {
sendKeyboardTWO();
}
}
It's simple but a little messy if you have a lot of different keyboards to show, but it's a starting point.
from telegrambotphp.
You need someway ti store the state of a chat, like a database.
Everytime you send a new keyboard, you write it down on the db and when you receive a "back button press" check on the db what the current keyboard is and send the previous one (updating the db accordingly).
from telegrambotphp.
ok thank you for your guidance , just something else : i don't know what part
of the data need to use in database
On May 28 2016, at 11:52 am, Gabriele Grillo <[email protected]>
wrote:
You need someway ti store the state of a chat, like a database.
Everytime you send a new keyboard, you write it down on the db and when you
receive a "back button press" check on the db what the current keyboard is and
send the previous one (updating the db accordingly).—
You are receiving this because you authored the thread.
Reply to this email directly, [view it on GitHub](https://github.com/Eleirbag8
9/TelegramBotPHP/issues/14#issuecomment-222294832), or [mute the
thread](https://github.com/notifications/unsubscribe
/ANFGUJhL2yc_xVcPBAnE5582dORjXM2Fks5qF-
06gaJpZM4IpAen).![](https://github.com/notifications/beacon/ANFGUOhdmjU-
Eo2C1GCIx2bamBvwBgh2ks5qF-06gaJpZM4IpAen.gif)
from telegrambotphp.
can you write a source code ? :(
i need it ...
from telegrambotphp.
It's not a function of the Telegram's Bot API, so I'll not write a source code :-)
from telegrambotphp.
Hi @Eleirbag89 .
What do you mean with when you receive a "back button press" ??
Thanks
from telegrambotphp.
Related Issues (20)
- $telegram->getUpdateType()=='channel_post' not receiving channel updates HOT 1
- Unable to get phone number HOT 1
- Telegram::getChatMembersCount() method
- [BUG]
- Hi~~ @Eleirbag89 pls delete this issue,thanks!
- Web Apps HOT 8
- UpdateCount[BUG] HOT 2
- payment function HOT 1
- you have any video for this bot like tutorial ? HOT 1
- How to make wait for answer HOT 2
- Can you create .phar file for this project HOT 9
- [BUG]
- ErrorException Undefined array key "message" when using funtion UserID() HOT 3
- Formatting options HOT 3
- sendMediaGroup not working! HOT 1
- How to get user_id of the message of a user I reply to? HOT 1
- Add API Support for up to API 6.9 (22.09.2023) HOT 1
- Please Add Forward From Username HOT 1
- My button not a have actions
- how to send sticker HOT 1
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 telegrambotphp.