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)
if length > 1:
output += '=['
output_buffer += '=['
for i in range(length):
result += dice_results[i]
if length <= MAX_OUTPUT_CNT: # 显示数据含100
output += str(dice_results[i])
if i < length - 1:
output += '+'
output += ']'
output_buffer += str(dice_results[i])
if i < length - 1:
output_buffer += '+'
output_buffer += ']'
if self.count > MAX_OUTPUT_CNT: # 显示数据含100
output_buffer = '=' + msg.locale.t("dice.message.output.too_long", length=self.count)
output += output_buffer
else:
result = dice_results[0]
output += f'={result}'
@ -396,4 +398,4 @@ class DXDice(DiceItemBase):
if len(output) > MAX_OUTPUT_LEN:
output = msg.locale.t("dice.message.too_long")
self.detail = output
self.result = result
self.result = result