File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -616,6 +616,9 @@ ShellBot.init()
616616 declare -gr _TOKEN_=$token # TOKEN
617617 declare -gr _API_TELEGRAM_=" https://api.telegram.org/bot$_TOKEN_ " # API
618618
619+ # Testa conexão.
620+ curl -s " $_API_TELEGRAM_ " & > - || MessageError API ' não foi possível estabelecer conexão com o Telegram.'
621+
619622 # Um método simples para testar o token de autenticação do seu bot.
620623 # Não requer parâmetros. Retorna informações básicas sobre o bot em forma de um objeto Usuário.
621624 ShellBot.getMe ()
@@ -629,7 +632,7 @@ ShellBot.init()
629632 return $?
630633 }
631634
632- ShellBot.getMe & > /dev/null || MessageError API " $_ERR_TOKEN_UNAUTHORIZED_ " ' [-t, --token]'
635+ ShellBot.getMe & > - || MessageError API " $_ERR_TOKEN_UNAUTHORIZED_ " ' [-t, --token]'
633636
634637 # Salva as informações do bot.
635638 declare -gr _BOT_INFO_=(
@@ -5693,7 +5696,7 @@ _EOF
56935696 ShellBot.sendChatAction --chat_id $u_message_chat_id --action ${_BOT_RULES_[$i:bot_action]} & > /dev/null
56945697 fi
56955698 done
5696- ${_BOT_RULES_[$i:continue]:- return 0}
5699+ [[ ${_BOT_RULES_[$i:continue]} ]] || return 0
56975700 done
56985701
56995702 return 1
You can’t perform that action at this time.
0 commit comments