mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-26 04:17:46 +00:00
modules: move delete_message to sendMessage.sh
This commit is contained in:
parent
d3a1cecf1f
commit
c58fa22b7a
12
bashbot.sh
12
bashbot.sh
@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
|
||||
# 8 - curl/wget missing
|
||||
# 10 - not bash!
|
||||
#
|
||||
#### $$VERSION$$ v1.45-dev-14-gf842730
|
||||
#### $$VERSION$$ v1.45-dev-15-gd3a1cec
|
||||
##################################################################
|
||||
|
||||
# are we running in a terminal?
|
||||
@ -420,16 +420,6 @@ killallproc() {
|
||||
debug_checks "end killallproc" "$1"
|
||||
}
|
||||
|
||||
|
||||
# $ chat $2 msg_id $3 nolog
|
||||
declare -xr DELETE_URL=${URL}'/deleteMessage'
|
||||
delete_message() {
|
||||
[ -z "$3" ] && log_update "Delete Message CHAT=$1 MSG_ID=$2"
|
||||
sendJson "$1" '"message_id": '"$2"'' "${DELETE_URL}"
|
||||
# func="$1" err="$2" chat="$3" user="$4" emsg="$5" remaining args
|
||||
[ -n "${BOTSENT[ERROR]}" ] && processError "${FUNCNAME[0]}" "${BOTSENT[ERROR]}" "$1" "" "${BOTSENT[DESCRIPTION]}" "$2" "$3"
|
||||
}
|
||||
|
||||
# URL path for file id, $1 file_id
|
||||
# use download_file "path" to download file
|
||||
get_file() {
|
||||
|
@ -6,7 +6,7 @@
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
# shellcheck disable=SC1117
|
||||
#### $$VERSION$$ v1.45-dev-13-g117255a
|
||||
#### $$VERSION$$ v1.45-dev-15-gd3a1cec
|
||||
|
||||
# will be automatically sourced from bashbot
|
||||
|
||||
@ -98,6 +98,15 @@ edit_message_caption() {
|
||||
}
|
||||
|
||||
|
||||
# $ chat $2 msg_id $3 nolog
|
||||
delete_message() {
|
||||
[ -z "$3" ] && log_update "Delete Message CHAT=$1 MSG_ID=$2"
|
||||
sendJson "$1" '"message_id": '"$2"'' "${URL}/deleteMessage"
|
||||
# func="$1" err="$2" chat="$3" user="$4" emsg="$5" remaining args
|
||||
[ -n "${BOTSENT[ERROR]}" ] && processError "${FUNCNAME[0]}" "${BOTSENT[ERROR]}" "$1" "" "${BOTSENT[DESCRIPTION]}" "$2" "$3"
|
||||
}
|
||||
|
||||
|
||||
# internal function, send/edit formatted message with parse_mode and URL
|
||||
# $1 CHAT $2 message $3 action $4 URL
|
||||
_format_message_url(){
|
||||
|
Loading…
Reference in New Issue
Block a user