diff options
author | Jordan Bracco <href@random.sh> | 2023-03-02 15:43:20 +0100 |
---|---|---|
committer | Jordan Bracco <href@random.sh> | 2023-03-02 15:43:20 +0100 |
commit | e398b47b33681f167a070652368558caecc14a86 (patch) | |
tree | 0cc5e53d240fa20a4b18da33bd5f16b0731de7d9 /lib/plugins | |
parent | Various fixes, refs T77. (diff) |
More fixes
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/base.ex | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/plugins/base.ex b/lib/plugins/base.ex index 0f2c7e5..1baf066 100644 --- a/lib/plugins/base.ex +++ b/lib/plugins/base.ex @@ -18,13 +18,17 @@ defmodule Nola.Plugins.Base do def handle_info({:irc, :trigger, "plugins", msg = %{trigger: %{type: :bang, args: []}}}, _) do enabled_string = Nola.Plugins.enabled() - |> Enum.map(fn(mod) -> - mod - |> Macro.underscore() - |> String.split("/", parts: :infinity) - |> List.last() - |> Enum.sort() + |> Enum.map(fn(string_or_module) -> + case string_or_module do + string when is_binary(string) -> string + module when is_atom(module) -> + module + |> Macro.underscore() + |> String.split("/", parts: :infinity) + |> List.last() + end end) + |> Enum.sort() |> Enum.join(", ") msg.replyfun.("Enabled plugins: #{enabled_string}") {:noreply, nil} |