diff options
-rw-r--r-- | Admin.md | 1 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | config/config.exs | 12 | ||||
-rw-r--r-- | config/dev.exs | 4 | ||||
-rw-r--r-- | config/prod.exs | 2 | ||||
-rw-r--r-- | lib/irc/connection.ex | 6 | ||||
l--------- | lib/lsg_irc/.#youtube_handler.ex | 1 | ||||
-rw-r--r-- | lib/lsg_irc/alcolog_plugin.ex | 2 |
8 files changed, 24 insertions, 14 deletions
@@ -55,7 +55,6 @@ Everything is supposed to be ran inside a remote IEx console: `./bin/lsg remote` * History: `AlcoologPlugin.user_history(id)` - ### Remove an entry id = "" # Some account id @@ -2,6 +2,13 @@ Some stupid and badly coded IRC bot. Can be spotted as "bavaria" on irc.random.sh, but is multi-connections and also elsewhere (poor channels). +## Dependencies + +* Erlang and Elixir (OTP24+) to build a release. +* (Optional) Python 3 for: + * link plugin: pdftitle: `pip install pdftitle` + * txt plugin: markov: `pip install markovify` + ## Development To start your Phoenix server: @@ -41,7 +48,4 @@ Build a release using `MIX_ENV=prod mix release`. * partyline en pv * partyline! pour join la PL * parler en query <=> broadcast a tout les personnes qui ont "partyline!" -* account/admin auth by password? (hosts are not always stable) * reminder -* admin: /msg bot bsay message => broadcast message to channels -* admin: /msg bot say #channel message => message to #channel diff --git a/config/config.exs b/config/config.exs index 139e646..ba4426d 100644 --- a/config/config.exs +++ b/config/config.exs @@ -5,6 +5,11 @@ # is restricted to this project. use Mix.Config +config :logger, level: :debug +config :logger, :console, + format: "$date $time [$level$levelpad] $metadata$message\n", + metadata: :all + # General application configuration config :lsg, namespace: LSG @@ -38,6 +43,8 @@ config :logger, :console, config :mime, :types, %{"text/event-stream" => ["sse"]} +# THIS IS NOT USED ANYMORE! +# XXX: Make sure it is not used anymore and remove.. config :lsg, :irc, name: "irc bot", handlers: [ @@ -76,8 +83,11 @@ config :lsg, LSG.IRC.LastFmHandler, api_secret: "x" config :lsg, LSG.IRC.YouTubeHandler, - api_key: "x" + api_key: "x", + invidious: "yewtu.be" +config :mnesia, + dir: '.mnesia/#{Mix.env}/#{node()}' # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. diff --git a/config/dev.exs b/config/dev.exs index 24e9b16..23780c3 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -40,13 +40,9 @@ config :lsg, LSGWeb.Endpoint, ] ] -# Do not include metadata nor timestamps in development logs -config :logger, :console, format: "[$level] $message\n" - # Set a higher stacktrace during development. Avoid configuring such # in production as building large stacktraces may be expensive. config :phoenix, :stacktrace_depth, 20 import_config "secret.exs" import_config "dev.secret.exs" - diff --git a/config/prod.exs b/config/prod.exs index 4e00b42..b970a5d 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -3,7 +3,5 @@ use Mix.Config config :lsg, LSGWeb.Endpoint, http: [ip: {0,0,0,0}, port: 4000] -config :logger, level: :debug - import_config "secret.exs" import_config "prod.secret.exs" diff --git a/lib/irc/connection.ex b/lib/irc/connection.ex index 3d27f93..fee84c3 100644 --- a/lib/irc/connection.ex +++ b/lib/irc/connection.ex @@ -196,10 +196,14 @@ defmodule IRC.Connection do "?" => :query, "." => :dot, "~" => :tilde, + "@" => :at, "++" => :plus_plus, "--" => :minus_minus, "!!" => :bang_bang, "??" => :query_query, + ".." => :dot_dot, + "~~" => :tilde_tilde, + "@@" => :at_at } def handle_continue(:connect, state) do @@ -367,7 +371,7 @@ defmodule IRC.Connection do end def handle_info(unhandled, client) do - IO.puts inspect(unhandled) + Logger.debug("unhandled: #{inspect unhandled}") {:noreply, client} end diff --git a/lib/lsg_irc/.#youtube_handler.ex b/lib/lsg_irc/.#youtube_handler.ex deleted file mode 120000 index 0557ec1..0000000 --- a/lib/lsg_irc/.#youtube_handler.ex +++ /dev/null @@ -1 +0,0 @@ -href@echoes.1780
\ No newline at end of file diff --git a/lib/lsg_irc/alcolog_plugin.ex b/lib/lsg_irc/alcolog_plugin.ex index 290be50..8360b3c 100644 --- a/lib/lsg_irc/alcolog_plugin.ex +++ b/lib/lsg_irc/alcolog_plugin.ex @@ -57,7 +57,7 @@ defmodule LSG.IRC.AlcoologPlugin do def init(_) do triggers = for(t <- @pubsub_triggers, do: "trigger:"<>t) for sub <- @pubsub ++ triggers do - {:ok, _} = Registry.register(IRC.PubSub, "account", plugin: __MODULE__) + {:ok, _} = Registry.register(IRC.PubSub, sub, plugin: __MODULE__) end dets_filename = (LSG.data_path() <> "/" <> "alcoolisme.dets") |> String.to_charlist {:ok, dets} = :dets.open_file(dets_filename, [{:type,:bag}]) |