diff --git a/bin/send_edit_message.sh b/bin/send_edit_message.sh new file mode 100755 index 0000000..a9eb7ac --- /dev/null +++ b/bin/send_edit_message.sh @@ -0,0 +1,73 @@ +#!/bin/bash +#=============================================================================== +# +# FILE: send_message.sh +# +# USAGE: send_edit_message.sh [-h|--help] [format] "CHAT[ID]" "MESSAGE[ID]" "message ...." [debug] +# +# DESCRIPTION: replace a message in the given user/group +# +# OPTIONS: format - normal, markdown, html (optional) +# CHAT[ID] - ID number of CHAT +# MESSAGE[ID] - message to replace +# message - message to send in specified format +# if no format is given send_normal_message() format is used +# +# -h - display short help +# --help - this help +# +# Set BASHBOT_HOME to your installation directory +# +# LICENSE: WTFPLv2 http://www.wtfpl.net/txt/copying/ +# AUTHOR: KayM (gnadelwartz), kay@rrr.de +# CREATED: 23.12.2020 16:52 +# +#### $$VERSION$$ v1.2-dev2-52-g20bfef1 +#=============================================================================== + +# set bashbot environment +# shellcheck disable=SC1090 +source "${0%/*}/bashbot_env.inc.sh" + +#### +# parse args +SEND="edit_normal_message" +case "$1" in + "nor*"|"tex*") + SEND="edit_normal_message" + shift + ;; + "mark"*) + SEND="edit_markdownv2_message" + shift + ;; + "html") + SEND="edit_html_message" + shift + ;; + '') + echo "missing missing arguments" + ;& + "-h"*) + echo 'usage: send_edit_message [-h|--help] [format] "CHAT[ID]" "MESSAGE[ID]" "message ..." [debug]' + exit 1 + ;; + '--h'*) + sed -n '3,/###/p' <"$0" + exit 1 + ;; +esac + +# source bashbot and send message +# shellcheck disable=SC1090 +source "${BASHBOT_HOME}/bashbot.sh" source "$3" + +#### +# ready, do stuff here ----- + +# send message in selected format +"${SEND}" "$1" "$2" "$3" + +# output send message result +jssh_printDB "BOTSENT" | sort -r + diff --git a/dev/make-distribution.sh b/dev/make-distribution.sh index 4413a83..a46eb59 100755 --- a/dev/make-distribution.sh +++ b/dev/make-distribution.sh @@ -2,7 +2,7 @@ # file: make-distribution.sh # creates files and arcchives to dirtribute bashbot # -#### $$VERSION$$ v1.2-dev2-49-gf56b7ae +#### $$VERSION$$ v1.2-dev2-51-g05bb23a # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script