20 lines
652 B
Bash
Executable File
20 lines
652 B
Bash
Executable File
#!/usr/bin/env bash
|
|
[ -f functions.sh ] && source functions.sh
|
|
|
|
# Dependencies required by this module
|
|
dependencies=("curl")
|
|
|
|
# Check dependencies before running
|
|
if ! check_dependencies "${dependencies[@]}"; then
|
|
msg "$2" "$1: This module requires: ${dependencies[*]}"
|
|
exit 1
|
|
fi
|
|
|
|
type="$(shuf -n1 -e "off" "you" "donut" "shakespeare" "linus" "king" "chainsaw" "madison")"
|
|
response="$(curl -s --connect-timeout 5 --max-time 10 -H "Accept: text/plain" "https://foaas.com/${type}/$3/$nick")"
|
|
if [[ -z "$response" || ${#response} -lt 5 ]]; then
|
|
msg "$2" "$1: Sorry, the FOAAS service is unavailable right now."
|
|
else
|
|
msg "$2" "$response"
|
|
fi
|