Exclude localhost from telegram messages.

This commit is contained in:
Pim Kunis 2019-10-25 13:36:16 +02:00
parent 7ea4dd1752
commit 377bf5b2de

View file

@ -13,7 +13,7 @@ defmodule UiWeb.MorseLive do
end
def handle_event("toggle_morse", _value, %{assigns: %{ip: ip}} = socket) do
if Morse.Server.in_progress?() do
if Morse.Server.in_progress?() and ip != "127.0.0.1" do
spawn fn -> Ui.TelegramBot.message("#{ip} pressed the button!") end
end
Morse.Server.toggle_morse()