diff --git a/konata.sh b/konata.sh index 6268c28..a8fcc59 100755 --- a/konata.sh +++ b/konata.sh @@ -13,8 +13,12 @@ user=$(jq -r '.message.from.username' <<< $input) sendmsg(){ # Escape any special characters first, see https://0x0.st/NO7J. fmt=$(sed 's/[][~!@#$%^&*()-_=+{}\|;:",<.>/?'"'"']/\\&/g' <<< $1 | sed 's/\t//g') + sendraw "$fmt" +} +sendraw(){ curl -X POST "https://api.telegram.org/bot$token/sendMessage" \ - -d "chat_id=$chat" -d "parse_mode=markdownv2" -d "text=$fmt" + -d "chat_id=$chat" -d "parse_mode=markdownv2" \ + -d "disable_web_page_preview=true" -d "text=$1" } help(){ @@ -65,6 +69,10 @@ id(){ sendmsg "Chat ID: $chat" } +anyone(){ + sendraw "Quite possibly\. [Why do you ask?](https://dontasktoask.com)" +} + tag(){ sendmsg "Please stand by, he'll get to your message soon™️..." } @@ -88,6 +96,7 @@ case "$cmd" in /cv*|/corona*) cv ;; /id*) id ;; /term*) term ;; + !anyone) anyone ;; *@ghnou*) tag ;; *@konatasanbot*) hiya ;; esac