rm '== True'
This commit is contained in:
26
bot.py
26
bot.py
@ -556,11 +556,11 @@ def on_chat(msg):
|
|||||||
|
|
||||||
# homepage
|
# homepage
|
||||||
elif command[0] == '/start' or command[0] == '首頁🏠':
|
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)
|
user.show_homepage(chat_id)
|
||||||
|
|
||||||
elif command[0] == '/question' or command[0] == '題庫📝' or command[0] == '更新🔃':
|
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:
|
if len(command) > 1:
|
||||||
user.show_question(command[1], chat_id)
|
user.show_question(command[1], chat_id)
|
||||||
else:
|
else:
|
||||||
@ -568,7 +568,7 @@ def on_chat(msg):
|
|||||||
|
|
||||||
elif chat_type == 'private':
|
elif chat_type == 'private':
|
||||||
if command[0] == '/password' or command[0] == '改密碼💱':
|
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()
|
user.press_oldpassword()
|
||||||
|
|
||||||
elif command[0] == '/logout' or command[0] == '登出🚪':
|
elif command[0] == '/logout' or command[0] == '登出🚪':
|
||||||
@ -577,44 +577,44 @@ def on_chat(msg):
|
|||||||
user.logout()
|
user.logout()
|
||||||
|
|
||||||
elif (command[0] == '/delete' or command[0] == '刪除作業⚔️') and user.question != '題外':
|
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()
|
user.delete_answer()
|
||||||
|
|
||||||
elif (command[0] == '/upload' or command[0] == '交作業📮') and user.question != '題外':
|
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()
|
user.upload_answer()
|
||||||
|
|
||||||
elif (command[0] == '/result' or command[0] == '看結果☑️') and user.question != '題外':
|
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()
|
user.list_results()
|
||||||
|
|
||||||
elif (command[0] == '/passer' or command[0] == '通過者🌐') and user.question != '題外':
|
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()
|
user.list_passers()
|
||||||
|
|
||||||
elif command[0] == '回題目📜' and user.question != '題外':
|
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)
|
user.show_question(user.question, chat_id)
|
||||||
|
|
||||||
elif user.status == '舊的密碼':
|
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'])
|
user.press_newpassword(msg['text'])
|
||||||
|
|
||||||
elif user.status == '修改密碼':
|
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'])
|
user.change_password(msg['text'])
|
||||||
|
|
||||||
elif user.status == '上傳答案':
|
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'], '')
|
user.send_answer(msg['text'], '')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if user.check_online(chat_id, msg['message_id']) == True:
|
if user.check_online(chat_id, msg['message_id']):
|
||||||
bot.sendMessage(chat_id, "(ˊ・ω・ˋ)")
|
bot.sendMessage(chat_id, "(ˊ・ω・ˋ)")
|
||||||
|
|
||||||
elif content_type == 'document':
|
elif content_type == 'document':
|
||||||
if user.status == '上傳答案' or user.status == '查看題目':
|
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:
|
if msg['document']['file_size'] > 167770000:
|
||||||
user.send_failed()
|
user.send_failed()
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user