Add /wttr command

This commit is contained in:
Michael De Roover 2021-05-08 18:15:43 +02:00
parent cd15bd464d
commit f592d7a8da
Signed by: vim
GPG Key ID: 075496E232CE04CB

View File

@ -92,6 +92,7 @@ help(){
- /4c [board] - Get a random image from 4chan. - /4c [board] - Get a random image from 4chan.
- /lfy [query] - Let me look that up for you... - /lfy [query] - Let me look that up for you...
- /ip [address] - Get information for an IP address. - /ip [address] - Get information for an IP address.
- /wttr [city] - Get the weather for a city.
- /repo - Get my source code. - /repo - Get my source code.
And a lot more to come!" And a lot more to come!"
@ -238,6 +239,12 @@ ip(){
<b>Time:</b> $(TZ=${data[9]} date +'%H:%M %Z')" <b>Time:</b> $(TZ=${data[9]} date +'%H:%M %Z')"
} }
wttr(){
args
res=$(curl wttr.in/${args[0]}?format=3)
sendmsg "$res"
}
repo(){ repo(){
sendmsg "You can find my source code <a href=\"https://git.nixmagic.com/ghnou/konata\">here</a>." sendmsg "You can find my source code <a href=\"https://git.nixmagic.com/ghnou/konata\">here</a>."
} }
@ -325,6 +332,7 @@ case "$cmd" in
/4c@$bot*) 4c ;; /4c@$bot*) 4c ;;
/lfy@$bot*) lfy ;; /lfy@$bot*) lfy ;;
/ip@$bot*) ip ;; /ip@$bot*) ip ;;
/wttr@$bot*) wttr ;;
/repo@$bot) repo ;; /repo@$bot) repo ;;
# Administrative # Administrative
/mp3@$bot*) mp3 ;; /mp3@$bot*) mp3 ;;