Make enabling take an optional argument
This commit is contained in:
parent
7b257d7835
commit
d9cb21377e
18
rowbot
18
rowbot
|
@ -741,12 +741,22 @@ hook_cmd_markov() {
|
||||||
|
|
||||||
case $action in
|
case $action in
|
||||||
enable)
|
enable)
|
||||||
enabled[$to]=yes
|
if (( ${#action_args[@]} )); then
|
||||||
privmsg "$to" "now recording $to"
|
enabled[${action_args[0]}]=yes
|
||||||
|
privmsg "$to" "now recording ${action_args[0]}"
|
||||||
|
else
|
||||||
|
enabled[$to]=yes
|
||||||
|
privmsg "$to" "now recording $to"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
disable)
|
disable)
|
||||||
enabled[$to]=no
|
if (( ${#action_args[@]} )); then
|
||||||
privmsg "$to" "no longer recording $to"
|
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\?)
|
enabled\?)
|
||||||
if [[ ${to:0:1} != \# || ${enabled[$to]} = yes ]]; then
|
if [[ ${to:0:1} != \# || ${enabled[$to]} = yes ]]; then
|
||||||
|
|
Loading…
Reference in New Issue