From 53b9b921987e5e61a6149f46ef98671da7907043 Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Sun, 5 Mar 2023 10:14:31 +0100 Subject: More fixes --- lib/telegram.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/telegram.ex') diff --git a/lib/telegram.ex b/lib/telegram.ex index f2c9eca..b161b63 100644 --- a/lib/telegram.ex +++ b/lib/telegram.ex @@ -15,9 +15,12 @@ defmodule Nola.Telegram do @impl Telegram.ChatBot def init(chat_id) when chat_id < 0 do - {:ok, state} = Nola.TelegramRoom.init(chat_id) - {:ok, %{room_state: state}} + case Nola.TelegramRoom.init(chat_id) do + {:ok, state} -> {:ok, %{room_state: state}} + _ -> :ignore + end end + def init(chat_id) do Logger.info("Telegram session starting: #{chat_id}") account = Nola.Account.find_meta_account("telegram-id", chat_id) -- cgit v1.2.3