mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 03:24:20 +00:00
roll
: Make qty optional
This commit is contained in:
parent
c1f03e5bdb
commit
48f01e65c7
2 changed files with 5 additions and 2 deletions
|
@ -111,7 +111,7 @@ register_telegram(tg_router, commands.fiorygi_bury, ["bury"],
|
|||
register_telegram(tg_router, commands.version, ["version"])
|
||||
register_telegram(tg_router, commands.cv, ["cv", "civù"])
|
||||
register_telegram(tg_router, commands.rocoinflip, ["rocoinflip"], r'"(?P<teama>[^"]+)"\s+"(?P<teamb>[^"]+)"')
|
||||
register_telegram(tg_router, commands.roll, ["roll"], r"(?P<qty>[0-9]*)d(?P<die>[0-9]+)(?P<mod>[+-][0-9]+)?")
|
||||
register_telegram(tg_router, commands.roll, ["roll"], r"(?P<qty>[0-9]*)?d(?P<die>[0-9]+)(?P<mod>[+-][0-9]+)?")
|
||||
register_telegram(tg_router, commands.diobot, ["diobot", "phrase"])
|
||||
register_telegram(tg_router, commands.loginprogress, ["loginprogress"])
|
||||
|
||||
|
|
|
@ -9,13 +9,16 @@ import royalpack.bolts as rb
|
|||
|
||||
@rb.capture_errors
|
||||
@engi.TeleportingConversation
|
||||
async def roll(*, _msg: engi.Message, qty: int, die: int, mod: t.Optional[int], **__):
|
||||
async def roll(*, _msg: engi.Message, qty: t.Optional[int], die: int, mod: t.Optional[int], **__):
|
||||
"""
|
||||
Tira un dado nel formato di D&D: `1d20+1`, ad esempio.
|
||||
|
||||
Non perfettamente casuale, **non usare per competizioni o altre cose serie**!
|
||||
"""
|
||||
|
||||
if qty is None:
|
||||
qty = 1
|
||||
|
||||
# modificatore supersegreto della fortuna. ooooh! questo è top secret!
|
||||
# "blame cate for this" --steffo
|
||||
|
||||
|
|
Loading…
Reference in a new issue