mirror of
https://github.com/danog/captionbot-clients.git
synced 2024-11-26 11:24:39 +01:00
Updated bot
This commit is contained in:
parent
c85f851c0d
commit
f4f1600217
@ -42,6 +42,8 @@ result=$(curl -s https://www.captionbot.ai/api/message -H "Content-Type: applica
|
||||
watermark=$(echo "$result" | sed '/\["WaterMark"\]/!d;s/\["WaterMark"\]\t//g')
|
||||
message=$(echo "$result" | sed '/\[".*Message"\]/!d;s/\[".*Message"\]\t//g;s/^"//g;s/"$//g;s/\\n/ /g')
|
||||
|
||||
[ "$2" = "script" ] && echo "$message" | grep -q "I really can't describe the picture" && exit 1
|
||||
|
||||
echo $message
|
||||
|
||||
[ "$2" = "script" ] && exit
|
||||
|
@ -3,16 +3,19 @@
|
||||
|
||||
if [ "$1" = "source" ];then
|
||||
# Edit the token in here
|
||||
# Set INLINE to 1 in order to receive inline queries.
|
||||
# Set INLINE to 1 in order to receive inline queries.
|
||||
# To enable this option in your bot, send the /setinline command to @BotFather.
|
||||
INLINE=0
|
||||
# Set to .* to allow sending files from all locations
|
||||
FILE_REGEX='/home/user/allowed/.*'
|
||||
else
|
||||
ALLOW="${URLS[PHOTO]} ${URLS[STICKER]} ${URLS[DOCUMENT]}"
|
||||
if ! tmux ls | grep -v send | grep -q $copname; then
|
||||
[ ! -z ${URLS[*]} ] && {
|
||||
[ ! -z $ALLOW ] && {
|
||||
send_action ${USER[ID]} typing
|
||||
result=$(./captionbot.sh ${URLS[*]} script)
|
||||
convert $ALLOW $NAME.jpg
|
||||
result=$(./captionbot.sh $NAME script)
|
||||
rm $NAME
|
||||
res=$(curl -s "$MSG_URL" -d "chat_id=${USER[ID]}" -d "text=$result" -d "reply_to_message_id=$MESSAGE_ID")
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user