File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5151,6 +5151,52 @@ _EOF
51515151 return $?
51525152 }
51535153
5154+ ShellBot.setMyCommands ()
5155+ {
5156+ :
5157+ }
5158+
5159+ ShellBot.BotCommand ()
5160+ {
5161+ local __command __description __list
5162+
5163+ local __param=$( getopt --name " $FUNCNAME " \
5164+ --options ' l:c:d:' \
5165+ --longoptions ' list:,
5166+ command:,
5167+ description:' \
5168+ -- " $@ " )
5169+
5170+ eval set -- " $__param "
5171+
5172+ while :
5173+ do
5174+ case $1 in
5175+ -l|--list) CheckArgType var " $1 " " $2 " ; __list=$2 ;;
5176+ -c|--command) __command=$2 ;;
5177+ -d|--description) __description=$2 ;;
5178+ --) break ;;
5179+ esac
5180+ shift 2
5181+ done
5182+
5183+ [[ $__list ]] || MessageError API " $_ERR_PARAM_REQUIRED_ " " [-l, --list]"
5184+ [[ $__command ]] || MessageError API " $_ERR_PARAM_REQUIRED_ " " [-c, --command]"
5185+ [[ $__description ]] || MessageError API " $_ERR_PARAM_REQUIRED_ " " [-d, --description]"
5186+
5187+ printf -v $__list " ${! __list# [} "
5188+ printf -v $__list " ${! __list% ]} "
5189+
5190+ printf -v $__list ' %s{"command": "%s", "description": "%s"}' \
5191+ " ${! __list: +${! __list} ,} " \
5192+ " $__command " \
5193+ " $__description "
5194+
5195+ printf -v $__list " [${! __list} ]"
5196+
5197+ return $?
5198+ }
5199+
51545200 ShellBot.setMessageRules ()
51555201 {
51565202 local action command user_id username chat_id
You can’t perform that action at this time.
0 commit comments