From 9e4ba7eaaa111feec5785252baff23e0770633d6 Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Thu, 31 Dec 2020 17:53:29 +0100 Subject: [PATCH] Add sendraw and anyone functions --- konata.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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