Skip to content

Commit

Permalink
🚨 auto fix by pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Aug 5, 2024
1 parent 5866428 commit cb08619
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion nonebot_plugin_roll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ async def _(matcher: Matcher):
if dice_result == 6324:
await matcher.send("彩蛋!6324工作室祝大家新年快乐!")

await matcher.finish(f"你掷出了{dice_num}{dice_side}面骰子, 点数为【{dice_result}】")
await matcher.finish(
f"你掷出了{dice_num}{dice_side}面骰子, 点数为【{dice_result}】"
)
12 changes: 9 additions & 3 deletions tests/test_roll.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ async def test_roll_legal(app: App):

event = make_event("/掷骰 0d999")
ctx.receive_event(bot, event)
ctx.should_call_send(event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None)
ctx.should_call_send(
event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None
)
ctx.should_finished(roll)

event = make_event("/掷骰 d0")
ctx.receive_event(bot, event)
ctx.should_call_send(event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None)
ctx.should_call_send(
event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None
)
ctx.should_finished(roll)

event = make_event("/rd -1d1")
ctx.receive_event(bot, event)
ctx.should_call_send(event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None)
ctx.should_call_send(
event, "错误!你掷出了不存在的骰子, 只有上帝知道结果是多少🤔", result=None
)
ctx.should_finished(roll)

event = make_event("/rd d1000")
Expand Down

0 comments on commit cb08619

Please sign in to comment.