Add more IRC handlers

This commit is contained in:
Nick Chambers 2021-06-26 16:25:19 -05:00
parent 425f3fef7a
commit 21c8d58459
1 changed files with 14 additions and 0 deletions

14
rowbot
View File

@ -410,6 +410,14 @@ on_JOIN() {
info "%s has joined %s" "$from" "${args[0]}"
}
on_KICK() {
if (( ${#args[@]} == 3 )); then
info "%s has kicked %s from %s: %s" "$from" "${args[1]}" "${args[0]}" "${args[@]:(-1)}"
else
info "%s has kicked %s from %s" "$from" "${args[1]}" "${args[0]}"
fi
}
on_MODE() {
if (( ${#args[@]} == 2 )); then
info "%s sets mode(s) %s on %s" "$from" "${args[1]}" "${args[0]}"
@ -592,6 +600,12 @@ on_433() {
fi
}
on_438() {
# The result will always be a string, since its the last index of the array.
# shellcheck disable=SC2145
error "${args[1]} couldn't change their nick to ${args[2]}: ${args[@]:(-1)}"
}
on_473() {
error "%s: %s" "${args[1]}" "${args[2]}"
}