From fd4afd7c7acd9b5fda75b628a7e19d0149d8b889 Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Sat, 17 Dec 2022 13:47:11 +0000 Subject: Nola rename cont. pt. 2. Refs T77. `find lib -name "*.ex" -type f | xargs sed -i '' 's/LSG/Nola/g'` --- lib/lsg_telegram/room.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/lsg_telegram/room.ex') diff --git a/lib/lsg_telegram/room.ex b/lib/lsg_telegram/room.ex index 4e86382..794cca3 100644 --- a/lib/lsg_telegram/room.ex +++ b/lib/lsg_telegram/room.ex @@ -1,4 +1,4 @@ -defmodule LSG.TelegramRoom do +defmodule Nola.TelegramRoom do require Logger @behaviour Telegram.ChatBot alias Telegram.Api @@ -32,7 +32,7 @@ defmodule LSG.TelegramRoom do end def after_start() do - for id <- room(:ids), do: Telegram.Bot.ChatBot.Chat.Session.Supervisor.start_child(LSG.Telegram, Integer.parse(id) |> elem(0)) + for id <- room(:ids), do: Telegram.Bot.ChatBot.Chat.Session.Supervisor.start_child(Nola.Telegram, Integer.parse(id) |> elem(0)) end @impl Telegram.ChatBot @@ -125,7 +125,7 @@ defmodule LSG.TelegramRoom do if Map.get(message.meta, :from) == self() do else body = if Map.get(message.meta, :self), do: text, else: "<#{nick}> #{text}" - LSG.Telegram.send_message(state.id, body) + Nola.Telegram.send_message(state.id, body) end {:ok, state} end @@ -163,14 +163,14 @@ defmodule LSG.TelegramRoom do path = "https://api.telegram.org/file/bot#{token}/#{file["file_path"]}", {:ok, %HTTPoison.Response{status_code: 200, body: body}} <- HTTPoison.get(path), <> = body, - {:ok, magic} <- GenMagic.Pool.perform(LSG.GenMagic, {:bytes, smol_body}), + {:ok, magic} <- GenMagic.Pool.perform(Nola.GenMagic, {:bytes, smol_body}), bucket = Application.get_env(:lsg, :s3, []) |> Keyword.get(:bucket), ext = Path.extname(file["file_path"]), s3path = "#{account.id}/#{file_unique_id}#{ext}", s3req = ExAws.S3.put_object(bucket, s3path, body, acl: :public_read, content_type: magic.mime_type), {:ok, _} <- ExAws.request(s3req) do - path = LSGWeb.Router.Helpers.url(LSGWeb.Endpoint) <> "/files/#{s3path}" + path = NolaWeb.Router.Helpers.url(NolaWeb.Endpoint) <> "/files/#{s3path}" txt = "#{type}: #{text}#{path}" connection = IRC.Connection.get_network(state.net) IRC.send_message_as(account, state.net, state.chan, txt, true) -- cgit v1.2.3