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