Compare commits

...

1 Commits

Author SHA1 Message Date
a97bf7d55c 摇骰子 2025-09-29 00:00:48 +08:00
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,12 @@
from nonebot_plugin_alconna import Alconna, Args, Field, UniMessage, on_alconna
from konabot.plugins.roll_dice.roll_dice import roll_dice
from konabot.plugins.weather.fetcher import fetch_radar
evt = on_alconna(Alconna(
"摇骰子"
), use_cmd_start=True, use_cmd_sep=False, skip_for_unmatch=True)
@evt.handle()
async def _():
await evt.send(await UniMessage().text(await roll_dice()).export())

View File

@ -0,0 +1,46 @@
number_arts = {
1: ''' _
/ |
| |
| |
|_|
''',
2: ''' ____
|___ \
__) |
/ __/
|_____|
''',
3: ''' _____
|___ /
|_ \
___) |
|____/
''',
4: ''' _ _
| || |
| || |_
|__ _|
|_|
''',
5: ''' ____
| ___|
|___ \
___) |
|____/
''',
6: ''' __
/ /_
| '_ \
| (_) |
\___/
'''
}
def get_random_number(min: int = 1, max: int = 6) -> int:
import random
return random.randint(min, max)
async def roll_dice() -> str:
return number_arts[get_random_number()]