rm '== True'
This commit is contained in:
26
bot.py
26
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:
|
||||
|
Reference in New Issue
Block a user