mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-26 20:30:50 +00:00
modules: sendMessage: add copy_message
This commit is contained in:
parent
429c230627
commit
52d1ac5618
@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
|
|||||||
# 8 - curl/wget missing
|
# 8 - curl/wget missing
|
||||||
# 10 - not bash!
|
# 10 - not bash!
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.45-dev-2-ga6ff405
|
#### $$VERSION$$ v1.45-dev-3-g429c230
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
# are we running in a terminal?
|
# are we running in a terminal?
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
|
# AUTHOR: KayM (gnadelwartz), kay@rrr.de
|
||||||
# CREATED: 27.01.2021 13:42
|
# CREATED: 27.01.2021 13:42
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.45-dev-2-ga6ff405
|
#### $$VERSION$$ v1.45-dev-3-g429c230
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# shellcheck disable=SC2059
|
# shellcheck disable=SC2059
|
||||||
|
|
||||||
@ -104,13 +104,13 @@ bot_init() {
|
|||||||
fi
|
fi
|
||||||
# adjust permissions
|
# adjust permissions
|
||||||
printf "Adjusting files and permissions for user \"${touser}\" ...\n"
|
printf "Adjusting files and permissions for user \"${touser}\" ...\n"
|
||||||
|
chown -Rf "${chown}" . ./*
|
||||||
chmod 711 .
|
chmod 711 .
|
||||||
chmod -R o-w ./*
|
chmod -R o-w ./*
|
||||||
chmod -R u+w "${COUNTFILE}"* "${BLOCKEDFILE}"* "${DATADIR}" logs "${LOGDIR}/"*.log 2>/dev/null
|
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
|
chmod -R o-r,o-w "${COUNTFILE}"* "${BLOCKEDFILE}"* "${DATADIR}" "${BOTACL}" 2>/dev/null
|
||||||
# jsshDB must writeable by owner
|
# jsshDB must writeable by owner
|
||||||
find . -name '*.jssh*' -exec chmod u+w \{\} +
|
find . -name '*.jssh*' -exec chmod u+w \{\} +
|
||||||
chown -Rf "${chown}" . ./*
|
|
||||||
printf "Done.\n"
|
printf "Done.\n"
|
||||||
# adjust values in bashbot.rc
|
# adjust values in bashbot.rc
|
||||||
if [ -w "bashbot.rc" ]; then
|
if [ -w "bashbot.rc" ]; then
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
#### $$VERSION$$ v1.45-dev-0-g9d36f23
|
#### $$VERSION$$ v1.45-dev-3-g429c230
|
||||||
|
|
||||||
# will be automatically sourced from bashbot
|
# will be automatically sourced from bashbot
|
||||||
|
|
||||||
@ -340,8 +340,11 @@ forward_message() {
|
|||||||
[ -z "$3" ] && return
|
[ -z "$3" ] && return
|
||||||
sendJson "$1" '"from_chat_id": '"$2"', "message_id": '"$3"'' "${URL}/forwardMessage"
|
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
|
# $1 CHAT $2 bashbot formatted message, see manual advanced usage
|
||||||
|
Loading…
Reference in New Issue
Block a user