From fd605a5b8bdde451cfd8d9497be970d5839270c9 Mon Sep 17 00:00:00 2001 From: Pin Lin Date: Sun, 6 May 2018 21:13:50 +0800 Subject: [PATCH] rm '== True' --- bot.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bot.py b/bot.py index 6b4fb5c..3600bda 100644 --- a/bot.py +++ b/bot.py @@ -556,11 +556,11 @@ def on_chat(msg): # homepage elif command[0] == '/start' or command[0] == '首頁🏠': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.show_homepage(chat_id) elif command[0] == '/question' or command[0] == '題庫📝' or command[0] == '更新🔃': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): if len(command) > 1: user.show_question(command[1], chat_id) else: @@ -568,7 +568,7 @@ def on_chat(msg): elif chat_type == 'private': if command[0] == '/password' or command[0] == '改密碼💱': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.press_oldpassword() elif command[0] == '/logout' or command[0] == '登出🚪': @@ -577,44 +577,44 @@ def on_chat(msg): user.logout() elif (command[0] == '/delete' or command[0] == '刪除作業⚔️') and user.question != '題外': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.delete_answer() elif (command[0] == '/upload' or command[0] == '交作業📮') and user.question != '題外': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.upload_answer() elif (command[0] == '/result' or command[0] == '看結果☑️') and user.question != '題外': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.list_results() elif (command[0] == '/passer' or command[0] == '通過者🌐') and user.question != '題外': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.list_passers() elif command[0] == '回題目📜' and user.question != '題外': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.show_question(user.question, chat_id) elif user.status == '舊的密碼': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.press_newpassword(msg['text']) elif user.status == '修改密碼': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.change_password(msg['text']) elif user.status == '上傳答案': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): user.send_answer(msg['text'], '') else: - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): bot.sendMessage(chat_id, "(ˊ・ω・ˋ)") elif content_type == 'document': if user.status == '上傳答案' or user.status == '查看題目': - if user.check_online(chat_id, msg['message_id']) == True: + if user.check_online(chat_id, msg['message_id']): if msg['document']['file_size'] > 167770000: user.send_failed() else: