Implement more IRC message handlers

This commit is contained in:
Nick Chambers 2021-06-15 13:32:35 -05:00
parent ee8011c0bf
commit c7a0f8896f
1 changed files with 26 additions and 0 deletions

26
rowbot
View File

@ -155,6 +155,10 @@ on_PONG() {
debug "received pong: %s" "${params[1]}"
}
on_PRIVMSG() {
info "<%s/%s> %s" "$from" "${params[0]}" "${params[1]}"
}
on_QUIT() {
info "%s has disconnected: %s" "$from" "${params[0]}"
}
@ -230,6 +234,24 @@ on_266() {
info %s "${params[3]}"
}
on_332() {
info "topic for %s is %s" "${params[1]}" "${params[2]}"
}
on_333() {
local date
printf -v date '%(%c)T' "${params[3]}"
info "topic for %s set by %s at %s" "${params[1]}" "${params[2]}" "$date"
}
on_353() {
info "members of %s: %s" "${params[2]}" "${params[3]}"
}
on_366() {
debug "%s: end of NAMES list" "${params[1]}"
}
on_372() {
info %s "${params[1]}"
}
@ -242,6 +264,10 @@ on_376() {
debug %s "${params[1]}"
}
on_473() {
error "%s: %s" "${params[1]}" "${params[2]}"
}
###
# irc send code
###