diff options
author | href <href@random.sh> | 2021-09-02 07:05:42 +0200 |
---|---|---|
committer | href <href@random.sh> | 2021-09-02 07:05:42 +0200 |
commit | d14408c7e054619f2648eb0480fe55f60397e8c2 (patch) | |
tree | 077c0e0ecc33b7a1e4fa00023325db54f3cd40e8 /lib/lsg_irc/txt_plugin.ex | |
parent | exirc 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.ex | 10 |
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 |