diff options
author | Jordan Bracco <href@random.sh> | 2022-12-20 02:19:42 +0000 |
---|---|---|
committer | Jordan Bracco <href@random.sh> | 2022-12-20 19:29:41 +0100 |
commit | 9958e90eb5eb5a2cc171c40860745e95a96bd429 (patch) | |
tree | b49cdb1d0041b9c0a81a14950d38c0203896f527 /lib/nola_plugins/kick_roulette.ex | |
parent | Rename to Nola (diff) |
Actually do not prefix folders with nola_ refs T77
Diffstat (limited to 'lib/nola_plugins/kick_roulette.ex')
-rw-r--r-- | lib/nola_plugins/kick_roulette.ex | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/lib/nola_plugins/kick_roulette.ex b/lib/nola_plugins/kick_roulette.ex deleted file mode 100644 index f6d2ba2..0000000 --- a/lib/nola_plugins/kick_roulette.ex +++ /dev/null @@ -1,32 +0,0 @@ -defmodule Nola.Plugins.KickRoulette do - @moduledoc """ - # kick roulette - - * **!kick**, tentez votre chance⦠- """ - - def irc_doc, do: @moduledoc - def start_link() do - GenServer.start_link(__MODULE__, [], name: __MODULE__) - end - - def init([]) do - {:ok, _} = Registry.register(IRC.PubSub, "trigger:kick", [plugin: __MODULE__]) - {:ok, nil} - end - - def handle_info({:irc, :trigger, "kick", message = %{trigger: %{type: :bang, args: []}}}, _) do - if 5 == :crypto.rand_uniform(1, 6) do - spawn(fn() -> - :timer.sleep(:crypto.rand_uniform(200, 10_000)) - message.replyfun.({:kick, message.sender.nick, "perdu"}) - end) - end - {:noreply, nil} - end - - def handle_info(msg, _) do - {:noreply, nil} - end - -end |