modules: sendMessage: add copy_message

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-02-07 17:05:34 +01:00
parent 429c230627
commit 52d1ac5618
3 changed files with 9 additions and 6 deletions

View File

@ -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-2-ga6ff405
#### $$VERSION$$ v1.45-dev-3-g429c230
##################################################################
# are we running in a terminal?

View File

@ -11,7 +11,7 @@
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
# CREATED: 27.01.2021 13:42
#
#### $$VERSION$$ v1.45-dev-2-ga6ff405
#### $$VERSION$$ v1.45-dev-3-g429c230
#===============================================================================
# shellcheck disable=SC2059
@ -104,13 +104,13 @@ bot_init() {
fi
# adjust permissions
printf "Adjusting files and permissions for user \"${touser}\" ...\n"
chown -Rf "${chown}" . ./*
chmod 711 .
chmod -R o-w ./*
chmod -R u+w "${COUNTFILE}"* "${BLOCKEDFILE}"* "${DATADIR}" logs "${LOGDIR}/"*.log 2>/dev/null
chmod -R o-r,o-w "${COUNTFILE}"* "${BLOCKEDFILE}"* "${DATADIR}" "${BOTACL}" 2>/dev/null
# jsshDB must writeable by owner
find . -name '*.jssh*' -exec chmod u+w \{\} +
chown -Rf "${chown}" . ./*
printf "Done.\n"
# adjust values in bashbot.rc
if [ -w "bashbot.rc" ]; then

View File

@ -6,7 +6,7 @@
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
# shellcheck disable=SC1117
#### $$VERSION$$ v1.45-dev-0-g9d36f23
#### $$VERSION$$ v1.45-dev-3-g429c230
# will be automatically sourced from bashbot
@ -340,8 +340,11 @@ forward_message() {
[ -z "$3" ] && return
sendJson "$1" '"from_chat_id": '"$2"', "message_id": '"$3"'' "${URL}/forwardMessage"
}
forward() { # backward compatibility
forward_message "$@" || return
# $1 CHAT $2 from chat $3 from msg id
copy_message() {
[ -z "$3" ] && return
sendJson "$1" '"from_chat_id": '"$2"', "message_id": '"$3"'' "${URL}/copyMessage"
}
# $1 CHAT $2 bashbot formatted message, see manual advanced usage