add ternary operator
This commit is contained in:
parent
02b2336b98
commit
d6c1fa0aff
2
main.py
2
main.py
@ -106,7 +106,7 @@ def send_stats(message):
|
||||
chat_id = str(message.chat.id)
|
||||
user_id = str(message.from_user.id)
|
||||
#if str(message.from_user.id)==db[str(message.chat.id)]:
|
||||
bot.send_message(chat_id, f"Количество потраченных обедов [{telebot.util.user_link(message.from_user)}]: {db[chat_id][user_id]['lunch']}😿", parse_mode='HTML')
|
||||
bot.send_message(chat_id, f"Количество потраченных обедов [{telebot.util.user_link(message.from_user)}]: {db[chat_id][user_id]['lunch']}{'😿' if db[chat_id][user_id]['lunch'] > 0 else '😻'}", parse_mode='HTML')
|
||||
|
||||
@bot.message_handler()
|
||||
def catch_all_messages(message):
|
||||
|
@ -22,4 +22,4 @@ while True:
|
||||
try:
|
||||
schedule.run_pending()
|
||||
time.sleep(1)
|
||||
except: exit()
|
||||
except: ...
|
||||
|
Loading…
Reference in New Issue
Block a user