Answer the question
In order to leave comments, you need to log in
How to fix a Telegram bot stop?
I have a problem - the bot, when waiting for a message input from one user, does not respond to others.
def mathmatic(message):
# Словарь
answer = {}
# Список с серверами
onlyServer = [base[j][0] for j in range(len(base))]
for serv in onlyServer:
answer[serv] = 0
for i in diction.keys():
n = inputBot(message, f'Введите кол-во {i} данного предмета, если он отсутсвует у вас, то введите ноль ' )
if n.isdigit():
item = diction[i]
for el in item:
server = el[0]
priceOnOneServ = float( el[1] )
answer[server] = answer[server] + (priceOnOneServ * int(n) )
answer2 = [ [k,v] for k, v in answer.items()]
bubbleSort(answer2)
return answer2
Answer the question
In order to leave comments, you need to log in
https://surik00.gitbooks.io/aiogram-lessons/conten...
https://groosha.gitbook.io/telegram-bot-lessons/ch...
Or something like this:
userdata = {} # создали словарь
# где-нибудь спрашиваем у человек имя
userdata[message.user.id] = message.text
# делаем остальные шаги,
# читаем через userdata[message.user.id] и удаляем
del userdata[message.user.id]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question