Hello. My bot has sections. In every section user may

send message. How do I know what section belongs the message?

9 ответов

11 просмотров

inline buttons orqali yasaysiz. buttondagi callback ga kerakli belgilarni joylab qoysa boladi

Raxmatjon-Sulaymonov Автор вопроса

For example, if user send a income command bot works with incomes and user sends his incomes as text and if it is expense command user writes expenses. How to know what user sent: income or expense

Raxmatjon Sulaymonov
For example, if user send a income command bot wor...

You save information about the command. For example to a file or a database.

Raxmatjon-Sulaymonov Автор вопроса

So, if previous update(here-command) == (desired one) then ... ?

Raxmatjon Sulaymonov
So, if previous update(here-command) == (desired o...

Not exactly. The previous update may contain a message from another chat.

Raxmatjon-Sulaymonov Автор вопроса
Quad
Not exactly. The previous update may contain a mes...

How to do it if I cannot know the previous update from exact chat? Example. Botfather ask botname and username when you create. Where it knows what I sent, botname or username?

Raxmatjon-Sulaymonov Автор вопроса

Python

Raxmatjon Sulaymonov
Python

You can store the needed information in a dict and use the chat id as key.

Похожие вопросы

Карта сайта