diff options
-rw-r--r-- | hack_of_all_hacks | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hack_of_all_hacks b/hack_of_all_hacks index d908016..5a26909 100644 --- a/hack_of_all_hacks +++ b/hack_of_all_hacks @@ -233,6 +233,14 @@ EOF echo "${is}" >> "info/${thing}" send_msg "${channel_it_came_from}" "${personoslash}: Remembered." ;; + "pbot: "+([![:space:]])" is: "+([![:space:]])* ) + thing="${sentence#pbot: }" + thing="${thing%% is: *}" + is="${sentence#* is: }" + + echo "${is}" >> "info/${thing}" + send_msg "${channel_it_came_from}" "${personoslash}: Remembered." + ;; "pbot: "+([![:space:]])" isn't "+([![:space:]])* ) thing="${sentence#pbot: }" thing="${thing%% isn\'t *}" @@ -246,6 +254,19 @@ EOF send_msg "${channel_it_came_from}" "${personoslash}: I know." fi ;; + "pbot: "+([![:space:]])" isn't: "+([![:space:]])* ) + thing="${sentence#pbot: }" + thing="${thing%% isn\'t: *}" + isnt="${sentence#* isn\'t: }" + + if grep "${isnt}" "info/${thing}" + then + grep -v "${isnt}" "info/${thing}" | sponge "info/${thing}" + send_msg "${channel_it_came_from}" "${personoslash}: OK, entry removed." + else + send_msg "${channel_it_came_from}" "${personoslash}: I know." + fi + ;; ','+([![:space:]]) ) thing="${sentence#,}" |