summaryrefslogtreecommitdiff
path: root/lib/telegram.ex
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2023-03-05 10:14:31 +0100
committerJordan Bracco <href@random.sh>2023-03-05 10:14:31 +0100
commit53b9b921987e5e61a6149f46ef98671da7907043 (patch)
treece23bf045ed78e981c39a77589bca572965e0ad9 /lib/telegram.ex
parentlink/image with pyerlai (tbc) (diff)
Diffstat (limited to 'lib/telegram.ex')
-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)