mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-28 04:45:00 +00:00
log deleteMessage
This commit is contained in:
parent
215667b3ef
commit
35d5e05ea9
@ -11,7 +11,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.98-dev-37-g3cd8dc9
|
||||
#### $$VERSION$$ v0.98-dev-38-g215667b
|
||||
#
|
||||
# Exit Codes:
|
||||
# - 0 sucess (hopefully)
|
||||
@ -298,8 +298,10 @@ killallproc() {
|
||||
}
|
||||
|
||||
|
||||
# $ chat $2 mesgid $3 nolog
|
||||
declare -xr DELETE_URL=$URL'/deleteMessage'
|
||||
delete_message() {
|
||||
[ -z "$3" ] && printf "%s: Delete Message CHAT=%s MSG_ID=%s\n" "$(date)" "${1}" "${2}" >>"${UPDATELOG}"
|
||||
sendJson "${1}" '"message_id": '"${2}"'' "${DELETE_URL}"
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ see e.g. [Install Bash on Mac](http://macappstore.org/bash/)
|
||||
environment variable before running bashbot, e.g. the gnu versions of sed, grep, find ...
|
||||
|
||||
I considered to make bashbot BSD sed compatible, but much of the bashbot "magic" relies on
|
||||
(gnu) sed features, e.g. alternation ```|```, non printables ```\n\t\<```) or repeat ```?+``` pattern, not supported by BSD sed.
|
||||
(gnu) sed features, e.g. alternation ```|```, non printables ```\n\t\<``` or repeat ```?+``` pattern, not supported by BSD sed.
|
||||
BSD/MacOS sed compatibility will result in a rewrite of all grep/sed commands with an uncertain outcome,
|
||||
see [BSD/MacOS vs. GNU sed](https://riptutorial.com/sed/topic/9436/bsd-macos-sed-vs--gnu-sed-vs--the-posix-sed-specification)
|
||||
to get an impression how different they are.
|
||||
@ -107,5 +107,5 @@ The old format is supported for backward compatibility, but may fail for corner
|
||||
|
||||
#### [Next Create Bot](1_firstbot.md)
|
||||
|
||||
#### $$VERSION$$ v0.98-dev-35-gea27513
|
||||
#### $$VERSION$$ v0.98-dev-38-g215667b
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.98-dev-17-gdda5b6d
|
||||
#### $$VERSION$$ v0.98-dev-38-g215667b
|
||||
|
||||
# will be automatically sourced from bashbot
|
||||
|
||||
@ -75,7 +75,7 @@ old_send_keyboard() {
|
||||
ISEMPTY="ThisTextIsEmptyAndWillBeDeleted"
|
||||
sendEmpty() {
|
||||
sendJson "${@}"
|
||||
[[ "${2}" = *"${ISEMPTY}"* ]] && delete_message "${1}" "${BOTSENT[ID]}"
|
||||
[[ "${2}" = *"${ISEMPTY}"* ]] && delete_message "${1}" "${BOTSENT[ID]}" "nolog"
|
||||
}
|
||||
send_keyboard() {
|
||||
if [[ "$3" != *'['* ]]; then old_send_keyboard "${@}"; return; fi
|
||||
|
Loading…
Reference in New Issue
Block a user