D
D
DevilBoiz2021-05-09 02:45:06
Python
DevilBoiz, 2021-05-09 02:45:06

I can't figure out how State works on Aiogram python?

I know that there is an alternative to register_next_step_handler on Aiogram, how can I make it so that for any message that the user sends to the bot, the bot sends him the text "okay, I'll take this into account
" don't need
python

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jamoliddin Bakhriddinov, 2021-05-10
@DevilBoiz

import telebot


bot_token = "Ваш токен"
bot = telebot.TeleBot(token = bot_token)
tb = telebot.TeleBot(bot_token)
@bot.message_handler(commands=['start'])
def start(message):
    x = bot.send_message(message.chat.id, "Хорошо, учту это")
    bot.register_next_step_handler(x, send)
def send(message):
    #Мы можем получить сообщение, который ввёл пользователь и сохранить в памяти бота
    #К примеру vvel = message.text, отсюда наше новое значение под vvel = равно тому, что ввёл пользователь, а потом играться с ней сколько хотите.
    start(message)
bot.polling()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question