Make on_msg non-impactful by default

This commit is contained in:
Nick Chambers 2021-07-19 20:47:12 -05:00
parent db6df1ea90
commit bb0a43f3fc
1 changed files with 6 additions and 6 deletions

12
rowbot
View File

@ -871,7 +871,7 @@ on_init_limeometer() {
# nonlogger # nonlogger
on_msg_PRIVMSG_nolog() { on_early_msg_PRIVMSG_nolog() {
if [[ ${msg_words[0]} = *nolog* ]]; then if [[ ${msg_words[0]} = *nolog* ]]; then
log_info "this message was redacted" log_info "this message was redacted"
return 1 return 1
@ -942,14 +942,14 @@ on_register_alternick() {
config[registered]=yes config[registered]=yes
} }
on_msg_433_alternick() { on_early_msg_433_alternick() {
if [[ ${config[registered]} = yes ]]; then if [[ ${config[registered]} = yes ]]; then
log_debug "somebody is already using ${config[nick/]}" log_debug "somebody is already using ${config[nick/]}"
return 1 return 1
fi fi
} }
on_late_msg_433_alternick() { on_msg_433_alternick() {
if [[ ${config[registered]} = no ]]; then if [[ ${config[registered]} = no ]]; then
log_info "using nick ${config[nick]}_" log_info "using nick ${config[nick]}_"
irc_nick "${config[nick]}_" irc_nick "${config[nick]}_"
@ -963,7 +963,7 @@ annoyatron900_alternick() {
fi fi
} }
on_late_msg_NICK_alternick() { on_msg_NICK_alternick() {
if [[ ${msg[from]} = "${config[nick]}" ]]; then if [[ ${msg[from]} = "${config[nick]}" ]]; then
desired_nick= desired_nick=
log_info "got desired nick!" log_info "got desired nick!"
@ -1184,13 +1184,13 @@ while net_recv line; do
log_debug "bot score is %d" "${msg[score]}" log_debug "bot score is %d" "${msg[score]}"
if has irc_on_"${msg[cmd]}"; then if has irc_on_"${msg[cmd]}"; then
if run_callbacks "on_msg_${msg[cmd]}_"; then if run_callbacks "on_early_msg_${msg[cmd]}_"; then
irc_on_"${msg[cmd]}" irc_on_"${msg[cmd]}"
else else
log_debug "handler for %s was skipped" "${msg[cmd]}" log_debug "handler for %s was skipped" "${msg[cmd]}"
fi fi
run_callbacks "on_late_msg_${msg[cmd]}_" run_callbacks "on_msg_${msg[cmd]}_"
else else
log_warn "unhandled line: %s" "${msg[original]}" log_warn "unhandled line: %s" "${msg[original]}"
fi fi