diff --git a/modules/joke/joke.sh b/modules/joke/joke.sh index 4068aa7..5d5c681 100755 --- a/modules/joke/joke.sh +++ b/modules/joke/joke.sh @@ -1,5 +1,5 @@ [ -f functions.sh ] && source functions.sh -joke="$(curl -s 'https://thatsagooden.tk/?api=txt&type=all&exclude=sex,little_johnny')" +joke="$(curl -s --connect-timeout 5 'https://thatsagooden.tk/?api=txt&type=all&exclude=sex,little_johnny')" joke="${joke//[[:space:]]/ }" -msg "$2" "$joke" +[ -n "$joke" ] && msg "$2" "$joke" || msg "$2" "No jokes found."