Eliminate all generic magic

This commit is contained in:
Nick Chambers 2021-07-17 01:06:38 -05:00
parent 50be40354f
commit cf54d46348
1 changed files with 13 additions and 3 deletions

16
rowbot
View File

@ -411,6 +411,14 @@ on_sys_register_999_annoyatron900() {
log_debug "process %d is being annoying" "$alarm_pid"
}
on_sys_exit_997_annoyatron900() {
log_debug "shutting down annoyatron900"
if [[ -v alarm_pid ]] && is_running "$alarm_pid"; then
kill -STOP "$alarm_pid"
fi
}
###
# register with the server
###
@ -432,15 +440,17 @@ on_sys_register_999_welcome() {
if [[ ${config[chan]} ]]; then
irc_join "${config[chan]}"
fi
config[nick]=${msg_args[0]}
irc_who "${config[nick]}" %%uht,42
}
###
# magic required to make privmsg work
###
on_sys_register_001_privmagic() {
config[nick]=${msg_args[0]}
irc_who "${config[nick]}" %%uht,42
}
on_msg_354_privmagic() {
if (( msg_args[1] == 42 )); then
log_debug "received the identifying who"