Skip to content

Commit 59b4ff7

Browse files
committed
Correção na expansão de variáveis no método "ShellBot.setMessageRules" e a interpretação de caracteres especiais no método "ShellBot.KeyboardButton"
1 parent 62d8945 commit 59b4ff7

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

ShellBot.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
#-----------------------------------------------------------------------------------------------------------
44
# DATA: 07 de Março de 2017
@@ -146,8 +146,12 @@ FlagConv()
146146
local var str=$2
147147

148148
while [[ $str =~ \$\{([a-z_]+)\} ]]; do
149-
[[ ${BASH_REMATCH[1]} == @(${_VAR_INIT_// /|}) ]] && var=${BASH_REMATCH[1]}[$1] || var=
150-
str=${str//${BASH_REMATCH[0]}/${!var}}
149+
if [[ ${BASH_REMATCH[1]} == @(${_VAR_INIT_// /|}) ]]; then
150+
var=${BASH_REMATCH[1]}[$1]
151+
str=${str//${BASH_REMATCH[0]}/${!var}}
152+
else
153+
str=${str//${BASH_REMATCH[0]}}
154+
fi
151155
done
152156

153157
echo "$str"
@@ -1738,7 +1742,7 @@ ShellBot.init()
17381742
shift 2
17391743
;;
17401744
-t|--text)
1741-
__text=$2
1745+
__text=$(echo -e "$2")
17421746
shift 2
17431747
;;
17441748
-c|--request_contact)

0 commit comments

Comments
 (0)