Implement a shiny new sysfacts

This commit is contained in:
Nick Chambers 2021-06-20 01:31:04 -05:00
parent d851e1508c
commit b425a3acad
1 changed files with 12 additions and 0 deletions

12
rowbot
View File

@ -640,6 +640,18 @@ hook_cmd_factoids() {
esac
}
hook_cmd_sysroot() {
if [[ -d $sys_root && $action = sysfact ]]; then
local files=( "$sys_root"/* ) idx msg
if (( ${#files[@]} )); then
(( idx = RANDOM % ${#files[@]} ))
msg=$(<"${files[$idx]}")
privmsg "$to" "sysfact #$(( idx + 1 )): $msg"
fi
fi
}
hook_cmd_control_panel() {
if [[ $from != "$owner" && $dev != yes ]]; then
return 0