Merge branch 'sysroot' of uplime/rowbot into master

This commit is contained in:
Nick Chambers 2021-06-20 06:31:45 +00:00 committed by Gogs
commit 2ce50300ce
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