add ternary operator

main
ramjm 7 months ago
parent 02b2336b98
commit d6c1fa0aff

@ -106,7 +106,7 @@ def send_stats(message):
chat_id = str(message.chat.id) chat_id = str(message.chat.id)
user_id = str(message.from_user.id) user_id = str(message.from_user.id)
#if str(message.from_user.id)==db[str(message.chat.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() @bot.message_handler()
def catch_all_messages(message): def catch_all_messages(message):

@ -22,4 +22,4 @@ while True:
try: try:
schedule.run_pending() schedule.run_pending()
time.sleep(1) time.sleep(1)
except: exit() except: ...

Loading…
Cancel
Save