mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-28 20:52:36 +00:00
Add delete message support
since API v3 its possible to delete bot messages or any message if your bot is admin.
This commit is contained in:
parent
44d96a9b8b
commit
9d149bde7a
@ -45,6 +45,7 @@ ACTION_URL=$URL'/sendChatAction'
|
||||
FORWARD_URL=$URL'/forwardMessage'
|
||||
INLINE_QUERY=$URL'/answerInlineQuery'
|
||||
ME_URL=$URL'/getMe'
|
||||
DELETE_URL=$URL'/deleteMessage'
|
||||
ME=$(curl -s $ME_URL | ./JSON.sh/JSON.sh -s | egrep '\["result","username"\]' | cut -f 2 | cut -d '"' -f 2)
|
||||
|
||||
|
||||
@ -145,6 +146,10 @@ send_html_message() {
|
||||
done
|
||||
}
|
||||
|
||||
delete_message() {
|
||||
res=$(curl -s "$DELETE_URL" -F "chat_id=$1" -F "message_id=$2")
|
||||
}
|
||||
|
||||
kick_chat_member() {
|
||||
res=$(curl -s "$KICK_URL" -F "chat_id=$1" -F "user_id=$2")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user