Archived
1
0
Fork 0

Update dice.py

This commit is contained in:
多羅狼 2024-03-27 08:47:58 +08:00 committed by GitHub
parent fca179556d
commit af6eb86577
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -142,14 +142,16 @@ class Dice(DiceItemBase):
# 公用加法 # 公用加法
length = len(dice_results) length = len(dice_results)
if length > 1: if length > 1:
output += '=[' output_buffer += '=['
for i in range(length): for i in range(length):
result += dice_results[i] result += dice_results[i]
if length <= MAX_OUTPUT_CNT: # 显示数据含100 output_buffer += str(dice_results[i])
output += str(dice_results[i]) if i < length - 1:
if i < length - 1: output_buffer += '+'
output += '+' output_buffer += ']'
output += ']' if self.count > MAX_OUTPUT_CNT: # 显示数据含100
output_buffer = '=' + msg.locale.t("dice.message.output.too_long", length=self.count)
output += output_buffer
else: else:
result = dice_results[0] result = dice_results[0]
output += f'={result}' output += f'={result}'