diff --git a/rowbot b/rowbot index f80b501..e8a29b5 100755 --- a/rowbot +++ b/rowbot @@ -954,7 +954,17 @@ factoids_cmd_ls() { } plugin_not_found_factoids() { - true + if [[ -f "${config[fact-root]}"/"${msg[to]}"/"$action" ]]; then + # The exit status isn't important here. + # shellcheck disable=SC2155 + local fact=$(<"${config[fact-root]}"/"${msg[to]}"/"$action") + + if [[ ${action_args[0]} = \> ]] && (( ${#action_args[@]} > 1 )); then + irc_privmsg "${msg[to]}" "${action_args[-1]}: $fact" + else + irc_privmsg "${msg[to]}" "${msg[from]}: $fact" + fi + fi } on_init_factoids() {