summaryrefslogtreecommitdiff
path: root/lib/lsg_irc/txt_plugin.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2021-09-02 07:05:42 +0200
committerhref <href@random.sh>2021-09-02 07:05:42 +0200
commitd14408c7e054619f2648eb0480fe55f60397e8c2 (patch)
tree077c0e0ecc33b7a1e4fa00023325db54f3cd40e8 /lib/lsg_irc/txt_plugin.ex
parentexirc fork: use git repo (diff)
txt: don't search in files with dot, display them below in web
Diffstat (limited to '')
-rw-r--r--lib/lsg_irc/txt_plugin.ex10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/lsg_irc/txt_plugin.ex b/lib/lsg_irc/txt_plugin.ex
index 93c4bb1..2c9dfca 100644
--- a/lib/lsg_irc/txt_plugin.ex
+++ b/lib/lsg_irc/txt_plugin.ex
@@ -168,9 +168,13 @@ defmodule LSG.IRC.TxtPlugin do
result = with_stateful_results(msg, {:bang,"txt",msg.network,msg.channel,grep}, fn() ->
Enum.reduce(state.triggers, [], fn({trigger, data}, acc) ->
- Enum.reduce(data, acc, fn({l, _}, acc) ->
- [{trigger, l} | acc]
- end)
+ if !String.contains?(trigger, ".") do
+ Enum.reduce(data, acc, fn({l, _}, acc) ->
+ [{trigger, l} | acc]
+ end)
+ else
+ acc
+ end
end)
|> Enum.filter(fn({_, line}) ->
line