N
N
NickTheBuilder2019-12-07 21:18:44
Python
NickTheBuilder, 2019-12-07 21:18:44

How to switch from function to another function in python telegram bot?

How to make it so that when the function has completed, given the necessary data to the user and written a message, the bot starts to perform another function?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Duzive, 2019-12-09
@duzive

Create the function itself.
Then refer to it as usual :)
Example:

def get_sum(num1, num2):
    print(num1 + num2)
def get_param():
    x = int(input("number 1: "))
    y = int(input("number 2: "))
    get_sum(x, y)
get_param()

By analogy, you can do it with a Telegram bot.

F
flex7r, 2020-02-10
@flex7r

If you use the telebot library ( https://github.com/eternnoir/pyTelegramBotAPI).
That with the command:
bot.register_next_step_handler(message, функция)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question