Skip to content

Commit

Permalink
put hoabun in front since it's shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
chanomkaimuk committed Aug 2, 2024
1 parent 332f9f0 commit 132f2c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/taiwanese/quiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
class TaigiQuizChoice(QuizChoice):
def __init__(self, poj_unicode: str, is_correct: bool, engbun:str="", hoabun:str=""):
engbun = re.sub(r"<.*?>", "", engbun) # remove explanation in engbun, which is denoted by <>, since it might contain the answer
label = f"{engbun}" + f" ({hoabun})" if hoabun else ""
labels = (bun for bun in [hoabun, engbun] if bun) # only include non-empty labels
label = " | ".join(labels)
if len(label) > DISCORD_MAX_LABEL_LENGTH:
# discord only allows 80 characters for the label, so truncate if necessary
label = label[:DISCORD_MAX_LABEL_LENGTH]
Expand Down

0 comments on commit 132f2c6

Please sign in to comment.