diff options
Diffstat (limited to 'lib/lsg_irc/dice_handler.ex')
-rw-r--r-- | lib/lsg_irc/dice_handler.ex | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/lsg_irc/dice_handler.ex b/lib/lsg_irc/dice_handler.ex index b865100..b07b59b 100644 --- a/lib/lsg_irc/dice_handler.ex +++ b/lib/lsg_irc/dice_handler.ex @@ -4,14 +4,14 @@ defmodule LSG.IRC.DiceHandler do @moduledoc """ # dice - !dice [6 | faces] [1 | rolls] - roll X times a dice of X faces. + * **!dice `[1 | lancés]` `[6 | faces]`**: lance une ou plusieurs fois un dé de 6 ou autre faces """ @default_faces 6 @default_rolls 1 @max_rolls 50 + def short_irc_doc, do: "!dice (jeter un dé)" defstruct client: nil, dets: nil def irc_doc, do: @moduledoc @@ -31,9 +31,9 @@ defmodule LSG.IRC.DiceHandler do end def handle_info({:received, "!dice "<>params, sender, chan}, state) do - {faces, rolls} = case String.split(params, " ", parts: 2) do - [faces, rolls] -> {faces, rolls} - [faces] -> {faces, "1"} + {rolls, faces} = case String.split(params, " ", parts: 2) do + [faces, rolls] -> {rolls, faces} + [rolls] -> {rolls, @default_faces} end to_integer = fn(string, default) -> |