add language display
This commit is contained in:
10
interface.py
10
interface.py
@ -127,7 +127,7 @@ class Kuser:
|
|||||||
q_str = ''
|
q_str = ''
|
||||||
for key in q_dict.keys():
|
for key in q_dict.keys():
|
||||||
if q_dict[key][1] == '期限未到':
|
if q_dict[key][1] == '期限未到':
|
||||||
q_str += "📗<b>" + key + "</b> (DL: " + q_dict[key][0] + ")\n [[" + q_dict[key][2] + "]]"
|
q_str += "📗<b>" + key + "</b> (DL: " + q_dict[key][0] + ")\n [[" + q_dict[key][3] + "]] [[" + q_dict[key][2] + "]]"
|
||||||
q_str += "⚠️" if q_dict[key][2] == '未繳' else "✅"
|
q_str += "⚠️" if q_dict[key][2] == '未繳' else "✅"
|
||||||
q_str += " /question_" + key + "\n\n"
|
q_str += " /question_" + key + "\n\n"
|
||||||
bot.sendMessage(chat_id, "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
bot.sendMessage(chat_id, "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
||||||
@ -148,7 +148,7 @@ class Kuser:
|
|||||||
q_str = ''
|
q_str = ''
|
||||||
for key in q_dict.keys():
|
for key in q_dict.keys():
|
||||||
q_str += "📗" if q_dict[key][1] == '期限未到' else "📕"
|
q_str += "📗" if q_dict[key][1] == '期限未到' else "📕"
|
||||||
q_str += "<b>" + key + "</b> (DL: " + q_dict[key][0] + ")\n [[" + q_dict[key][2] + "]]"
|
q_str += "<b>" + key + "</b> (DL: " + q_dict[key][0] + ")\n [[" + q_dict[key][3] + "]] [[" + q_dict[key][2] + "]]"
|
||||||
q_str += "⚠️" if q_dict[key][2] == '未繳' else "✅"
|
q_str += "⚠️" if q_dict[key][2] == '未繳' else "✅"
|
||||||
q_str += " /question_" + key + "\n\n"
|
q_str += " /question_" + key + "\n\n"
|
||||||
reply = bot.sendMessage(chat_id, "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
reply = bot.sendMessage(chat_id, "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
||||||
@ -176,7 +176,7 @@ class Kuser:
|
|||||||
q_str = "💁 *" + self._username + "* [" + NAME + "]\n"
|
q_str = "💁 *" + self._username + "* [" + NAME + "]\n"
|
||||||
q_str += "➖➖➖➖➖\n"
|
q_str += "➖➖➖➖➖\n"
|
||||||
q_str += "📗" if q[1] == '期限未到' else "📕"
|
q_str += "📗" if q[1] == '期限未到' else "📕"
|
||||||
q_str += "*" + number + "* (DL: " + q[0] + ")\n [[[" + q[2] + "]]]"
|
q_str += "*" + number + "* (DL: " + q[0] + ")\n [[[" + q[3] + "]]] [[[" + q[2] + "]]]"
|
||||||
q_str += "⚠️" if q[2] == '未繳' else "✅"
|
q_str += "⚠️" if q[2] == '未繳' else "✅"
|
||||||
reply = bot.sendMessage(chat_id, q_str + "\n\n" + content,
|
reply = bot.sendMessage(chat_id, q_str + "\n\n" + content,
|
||||||
parse_mode='Markdown',
|
parse_mode='Markdown',
|
||||||
@ -215,7 +215,7 @@ class Kuser:
|
|||||||
q_str = "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
q_str = "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
||||||
q_str += "➖➖➖➖➖\n"
|
q_str += "➖➖➖➖➖\n"
|
||||||
q_str += "📗" if q[1] == '期限未到' else "📕"
|
q_str += "📗" if q[1] == '期限未到' else "📕"
|
||||||
q_str += "<b>" + self._question + "</b> (DL: " + q[0] + ")\n [[" + q[2] + "]]"
|
q_str += "<b>" + self._question + "</b> (DL: " + q[0] + ")\n [[" + q[3] + "]] [[" + q[2] + "]]"
|
||||||
q_str += "⚠️" if q[2] == '未繳' else "✅"
|
q_str += "⚠️" if q[2] == '未繳' else "✅"
|
||||||
bot.sendMessage(self._userid, q_str + "\n\n現在請把你的程式碼讓我看看(請別超過 20 MB)\n"
|
bot.sendMessage(self._userid, q_str + "\n\n現在請把你的程式碼讓我看看(請別超過 20 MB)\n"
|
||||||
"可以使用「文字訊息」或是「傳送檔案」的方式\n"
|
"可以使用「文字訊息」或是「傳送檔案」的方式\n"
|
||||||
@ -269,7 +269,7 @@ class Kuser:
|
|||||||
q_str = "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
q_str = "💁 <b>" + self._username + "</b> " + NAME + "\n"
|
||||||
q_str += "➖➖➖➖➖\n"
|
q_str += "➖➖➖➖➖\n"
|
||||||
q_str += "📗" if q[1] == '期限未到' else "📕"
|
q_str += "📗" if q[1] == '期限未到' else "📕"
|
||||||
q_str += "<b>" + self._question + "</b> (DL: " + q[0] + ")\n [[" + q[2] + "]]"
|
q_str += "<b>" + self._question + "</b> (DL: " + q[0] + ")\n [[" + q[3] + "]] [[" + q[2] + "]]"
|
||||||
q_str += "⚠️" if q[2] == '未繳' else "✅"
|
q_str += "⚠️" if q[2] == '未繳' else "✅"
|
||||||
q_str += "<code>\n"
|
q_str += "<code>\n"
|
||||||
for passer in self._api.list_passers(self._question):
|
for passer in self._api.list_passers(self._question):
|
||||||
|
3
kcoj.py
3
kcoj.py
@ -39,7 +39,8 @@ class KCOJ:
|
|||||||
deadline = tag.find_all('td')[3].get_text().strip()
|
deadline = tag.find_all('td')[3].get_text().strip()
|
||||||
submit = "期限已到" if tag.find_all('td')[4].get_text().strip() == "期限已過" else "期限未到"
|
submit = "期限已到" if tag.find_all('td')[4].get_text().strip() == "期限已過" else "期限未到"
|
||||||
status = tag.find_all('td')[6].get_text().strip()
|
status = tag.find_all('td')[6].get_text().strip()
|
||||||
questions[number] = (deadline, submit, status)
|
language = tag.find_all('td')[5].get_text().strip()
|
||||||
|
questions[number] = (deadline, submit, status, language)
|
||||||
return questions
|
return questions
|
||||||
except requests.exceptions.Timeout:
|
except requests.exceptions.Timeout:
|
||||||
return {'Timeout':('Timeout', 'Timeout', 'Timeout')}
|
return {'Timeout':('Timeout', 'Timeout', 'Timeout')}
|
||||||
|
Reference in New Issue
Block a user