diff --git a/lib/irc_bot.ex b/lib/irc_bot.ex index 34bac12..0f7780a 100644 --- a/lib/irc_bot.ex +++ b/lib/irc_bot.ex @@ -114,6 +114,16 @@ defmodule Discordirc.IRC do {:noreply, state} end + def handle_info(:disconnected, state) do + if state.ssl? do + Client.connect_ssl!(state.client, state.server, state.port) + else + Client.connect!(state.client, state.server, state.port) + end + + {:noreply, state} + end + def handle_info(_event, state) do {:noreply, state} end