From d9cb21377e38d4470b78a57b50aaeec8381988bc Mon Sep 17 00:00:00 2001 From: Nick Chambers Date: Wed, 23 Jun 2021 09:49:03 -0500 Subject: [PATCH] Make enabling take an optional argument --- rowbot | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/rowbot b/rowbot index 8bdeb7f..8a0b8d1 100755 --- a/rowbot +++ b/rowbot @@ -741,12 +741,22 @@ hook_cmd_markov() { case $action in enable) - enabled[$to]=yes - privmsg "$to" "now recording $to" + if (( ${#action_args[@]} )); then + enabled[${action_args[0]}]=yes + privmsg "$to" "now recording ${action_args[0]}" + else + enabled[$to]=yes + privmsg "$to" "now recording $to" + fi ;; disable) - enabled[$to]=no - privmsg "$to" "no longer recording $to" + if (( ${#action_args[@]} )); then + enabled[${action_args[0]}]=no + privmsg "$to" "no longer recording ${action_args[0]}" + else + enabled[$to]=yes + privmsg "$to" "no longer recording $to" + fi ;; enabled\?) if [[ ${to:0:1} != \# || ${enabled[$to]} = yes ]]; then