summaryrefslogtreecommitdiff
path: root/lib/telegram.ex
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/telegram.ex7
1 files changed, 5 insertions, 2 deletions
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)