From 5f203a9a3db09251c86f812b00bbafd482657def Mon Sep 17 00:00:00 2001 From: href Date: Fri, 23 Feb 2018 14:39:28 +0100 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/lsg_irc/kick_roulette_handler.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/lsg_irc/kick_roulette_handler.ex') diff --git a/lib/lsg_irc/kick_roulette_handler.ex b/lib/lsg_irc/kick_roulette_handler.ex index 7bfa90b..3591b5e 100644 --- a/lib/lsg_irc/kick_roulette_handler.ex +++ b/lib/lsg_irc/kick_roulette_handler.ex @@ -2,7 +2,7 @@ defmodule LSG.IRC.KickRouletteHandler do @moduledoc """ # kick roulette - * **!kick** (à peu près une chance sur 5) + * **!kick** """ def irc_doc, do: @moduledoc @@ -17,7 +17,10 @@ defmodule LSG.IRC.KickRouletteHandler do def handle_info({:received, "!kick", sender, chan}, client) do if 5 == :crypto.rand_uniform(1, 6) do - ExIRC.Client.kick(client, chan, sender.nick, "perdu") + spawn(fn() -> + :timer.sleep(:crypto.rand_uniform(500, 15_000)) + ExIRC.Client.kick(client, chan, sender.nick, "perdu") + end) end {:noreply, client} end -- cgit v1.2.3