This commit is contained in:
HonusBot 2021-05-15 23:08:31 +02:00
parent 9af7ec2623
commit 3ac6d76297
2 changed files with 19 additions and 1 deletions

1
1 Normal file
View File

@ -0,0 +1 @@
ciao2: command not found

View File

@ -3,5 +3,22 @@
command="$1"
shift
args="$@"
curl -s --location --request POST 'https://api.ignuranza.net/remote-command-api/command' --header 'Content-Type: application/json' --header 'User-Agent: RcAPI/1.2' --data-raw "{\"botName\": \"AstralNetworkHonusBot\", \"botPassword\": \"KixdujXD37898ZSy893\", \"command\": \"${command}\", \"replyToUserId\": 0, \"senderUserId\": 1237252783, \"chatId\": 1237252783, \"queryText\": \"$args\", \"rawSingleArgument\": false}" | jq -r ".imageUrl" | xargs --max-args=1 --no-run-if-empty curl -s --location | display -title "HonusBot CLI" -quiet
display_command="| display -title \"HonusBot CLI\" -quiet"
download_url_to_stdin=true
if [ -x "$(command -v feh)" ]; then
display_command="| feh"
download_url_to_stdin=false
fi
if [ -x "$(command -v viu)" ]; then
display_command="> /tmp/temp-honus.bin; viu /tmp/temp-honus.bin"
download_url_to_stdin=true
fi
if [ download_url_to_stdin = true ]; then
display_command="xargs --max-args=1 --no-run-if-empty curl -s --location ${display_command}"
fi
curl -s --location --request POST 'https://api.ignuranza.net/remote-command-api/command' --header 'Content-Type: application/json' --header 'User-Agent: RcAPI/1.2' --data-raw "{\"botName\": \"AstralNetworkHonusBot\", \"botPassword\": \"KixdujXD37898ZSy893\", \"command\": \"${command}\", \"replyToUserId\": 0, \"senderUserId\": 1237252783, \"chatId\": 1237252783, \"queryText\": \"$args\", \"rawSingleArgument\": false}" | jq -r ".imageUrl" | ${display_command}