Implement a shiny new sysfacts
This commit is contained in:
parent
aa96a2ee2a
commit
63c51c68cd
1 changed files with 12 additions and 0 deletions
12
rowbot
12
rowbot
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue