мне нужно остановить функцию так как нужно перейти на следующую функцию под названием math
вот код:
@bot.message_handler(commands=['start'])
def welcome(message):
bot.send_message(message.chat.id,'Привет!как ты?')
@bot.message_handler(content_types=['text'])
def porduce(message):
if message.text=='плохо':
bot.send_message(message.chat.id,'не расстраивайся')
elif message.text=='хорошо':
bot.send_message(message.chat.id,'вот и отлично')
else:
bot.send_message(message.chat.id,'ну и такое бывает')
@bot.message_handler(commands=['math'])
def math():
x=int(input("Введите первое: "))
y=int(input("Введите второе: "))
operation=input(" ")
if operation=='+':
print (x + y)
elif operation=='-':
print (x - y)
elif operation=='*':
print (x * y)
elif operation=='/':
print (x / y)
else:
print("введите правильный символ")
input
выполняется на сервере, где будет бот запущен, вы уверены, что именно так задумываете работать с ботом? :D