mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-24 11:55:55 +00:00
prepare for 0.72 release with working inline query
This commit is contained in:
parent
6afa177e4a
commit
9b850002ef
@ -97,6 +97,6 @@
|
||||
<p><span class="citation">@Gnadelwartz</span></p>
|
||||
<h2 id="thats-it">That’s it!</h2>
|
||||
<p>If you feel that there’s something missing or if you found a bug, feel free to submit a pull request!</p>
|
||||
<h4 id="version-v0.80-dev-2-g4e4194d"><br /><span class="math display"><em>V</em><em>E</em><em>R</em><em>S</em><em>I</em><em>O</em><em>N</em></span><br /> v0.80-dev-2-g4e4194d</h4>
|
||||
<h4 id="version-v0.72-dev-0-g6afa177"><br /><span class="math display"><em>V</em><em>E</em><em>R</em><em>S</em><em>I</em><em>O</em><em>N</em></span><br /> v0.72-dev-0-g6afa177</h4>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -94,4 +94,4 @@ Well, thats a damn good question ... may be because I'm an Unix/Linux admin from
|
||||
|
||||
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
@ -133,4 +133,4 @@ health status
|
||||
If you feel that there's something missing or if you found a bug, feel free to
|
||||
submit a pull request!
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# description: Start or stop telegram-bash-bot
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
# shellcheck disable=SC2009
|
||||
# shellcheck disable=SC2181
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.70-9-g2557ea7
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
#
|
||||
# Exit Codes:
|
||||
# - 0 sucess (hopefully)
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.70-10-gcbdfc7c
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
#
|
||||
# shellcheck disable=SC2154
|
||||
# shellcheck disable=SC2034
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# this has to run once atfer git clone
|
||||
# and every time we create new hooks
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# works together with git pre-push.sh and ADD all changed files since last push
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-3-g9bcab66
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
############
|
||||
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
############
|
||||
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# this has to run once atfer git clone
|
||||
# and every time we create new hooks
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# this has to run once atfer git clone
|
||||
# and every time we create new hooks
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
|
@ -1,3 +1,3 @@
|
||||
# list of additional files to check from shellcheck
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
bashbot.rc
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
# shellcheck disable=SC2016
|
||||
#
|
||||
# Easy Versioning in git:
|
||||
|
@ -63,5 +63,5 @@ The old format is supported for backward compatibility, but may fail for corner
|
||||
|
||||
#### [Next Create Bot](1_firstbot.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -65,5 +65,5 @@ group. This step is up to you actually.
|
||||
#### [Prev Installation](0_install.md)
|
||||
#### [Next Getting started](2_usage.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -179,5 +179,5 @@ send_action "${CHAT[ID]}" "action"
|
||||
#### [Prev Create Bot](1_firstbot.md)
|
||||
#### [Next Advanced Usage](3_advanced.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-3-g9bcab66
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -178,5 +178,5 @@ answer_inline_query "${iQUERY[ID]}" "cached_sticker" "identifier for the sticker
|
||||
#### [Prev Getting started](2_usage.md)
|
||||
#### [Next Expert Use](4_expert.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-3-g9bcab66
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -104,5 +104,5 @@ An example crontab is provided in ```examples/bashbot.cron```.
|
||||
#### [Prev Expert Use](4_expert.md)
|
||||
#### [Next Best Practice](5_practice.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -153,5 +153,5 @@ The second warning is about an unused variable, this is true because in our exam
|
||||
#### [Prev Best Practice](5_practice.md)
|
||||
#### [Next Functions Reference](6_reference.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -72,16 +72,6 @@ See also [deleteMessage limitations](https://core.telegram.org/bots/api#deleteme
|
||||
|
||||
----
|
||||
|
||||
##### answer_inline_query
|
||||
Inline Queries allows users to interact with your bot directly without sending extra commands.
|
||||
answer_inline_query provide the result to a users Inline Query
|
||||
|
||||
*usage:* answer_inline_query "$iQUERY_ID" "type" "type arg 1" ... "type arg n"
|
||||
|
||||
*example:* - see [Advanced Usage](3_advanced.md#Inline-queries)
|
||||
|
||||
----
|
||||
|
||||
### File, Location, Venue, Keyboard
|
||||
|
||||
|
||||
@ -251,8 +241,85 @@ fi
|
||||
|
||||
----
|
||||
|
||||
### Inline Queries - answer direct queries to bot
|
||||
You must include ```source modules/inline.sh``` in 'commands.sh' to have the following functions availible.
|
||||
|
||||
Inline Queries allows users to interact with your bot directly without sending extra commands.
|
||||
As an aswer to an inline query you can send back one or more results to the client. The Client
|
||||
will show the results to the user and let him selcet one.
|
||||
|
||||
##### answer_inline_query
|
||||
answer_inline_query is provided for backward compatibility with older versions of bashbot.
|
||||
It send back only one response to an inline query.
|
||||
|
||||
*usage:* answer_inline_query "$i{QUERY[ID]}" "type" "type arg 1" ... "type arg n"
|
||||
|
||||
*example:* - see [Advanced Usage](3_advanced.md#Inline-queries)
|
||||
|
||||
----
|
||||
|
||||
|
||||
##### answer_inline_multi
|
||||
anser_inline_multi allows you to send back a list of responses. responses must be seperated by ','.
|
||||
|
||||
*usage:* answer_inline_multi "${iQUERY[ID]}" "res, res, ... res"
|
||||
|
||||
*example:*
|
||||
```bash
|
||||
# note the starting " and ending " !!
|
||||
answer_inline_multi "${iQUERY[ID]}" "
|
||||
$(inline_query_compose "1" "photo" "https://avatars0.githubusercontent.com/u/13046303") ,
|
||||
...
|
||||
$(inline_query_compose "n" "photo" "https://avatars1.githubusercontent.com/u/4593242")
|
||||
"
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
#### inline_query_compose
|
||||
inline_query_compose composes one response element to to send back.
|
||||
|
||||
*usage:* inline_query_compose ID type args ....
|
||||
|
||||
```
|
||||
ID = unique ID for answer
|
||||
type = type of answer, e.g. article, photo, video, localtion ...
|
||||
args = arguments in the order as described in telegram doc, mandatory first, them optional
|
||||
```
|
||||
see [InlineQueryResult for more information](https://core.telegram.org/bots/api#inlinequeryresult)
|
||||
|
||||
|
||||
Currently the following types and args are implemented (optional args in parenthesis)
|
||||
```
|
||||
"article"|"message" title message (markup decription)
|
||||
|
||||
"photo" photo_URL (thumb_URL title description caption)
|
||||
"gif" photo_URL (thumb_URL title caption)
|
||||
"mpeg4_gif" mpeg_URL (thumb_URL title caption)
|
||||
"video" video_URL mime_type thumb_URL title (caption)
|
||||
"audio" audio_URL title (caption)
|
||||
"voice" voice_URL title (caption)
|
||||
"document" title document_URL mime_type (caption description)
|
||||
|
||||
"location" latitude longitude title
|
||||
"venue" latitude longitude title (adress foursquare)
|
||||
"contact" phone first (last thumb)
|
||||
|
||||
"cached_photo" file (title description caption)
|
||||
"cached_gif" file (title caption)
|
||||
"cached_mpeg4_gif" file (title caption)
|
||||
"cached_sticker" file
|
||||
"cached_document" title file (description caption)
|
||||
"cached_video" file title (description caption)
|
||||
"cached_voice" file title (caption)
|
||||
"cached_audio" file title (caption)
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
|
||||
### Aliases - shortcuts for often used funtions
|
||||
You must not disable ```source modules/aliases.sh``` in 'commands.sh' to have the following functions availible.
|
||||
You must include ```source modules/aliases.sh``` in 'commands.sh' to have the following functions availible.
|
||||
|
||||
##### _is_botadmin
|
||||
|
||||
@ -320,8 +387,8 @@ You must not disable ```source modules/aliases.sh``` in 'commands.sh' to have t
|
||||
|
||||
----
|
||||
|
||||
### Interactive and backgound jobs
|
||||
You must not disable ```source modules/background.sh``` in 'commands.sh' to have the following functions availible.
|
||||
### Background and Interactive jobs
|
||||
You must include ```source modules/background.sh``` in 'commands.sh' to have the following functions availible.
|
||||
|
||||
##### startproc
|
||||
```startproc``` starts a script, the output of the script is sent to the user or chat, user input will be sent back to the script. see [Advanced Usage](3_advanced.md#Interactive-Chats)
|
||||
@ -489,5 +556,5 @@ Send Input from Telegram to waiting Interactive Chat.
|
||||
#### [Prev Best Practice](5_practice.md)
|
||||
#### [Next Notes for Developers](7_develop.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -117,5 +117,5 @@ fi
|
||||
#### [Prev Function Reference](6_reference.md)
|
||||
#### [Next Bashbot Environment](8_custom.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -117,5 +117,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms.
|
||||
|
||||
#### [Prev Notes for Developers](7_develop.md)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
@ -55,6 +55,6 @@ convert existing bots.
|
||||
|
||||
**external-use** will contain some examples on how to send messages from external scripts to Telegram chats or users.
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
@ -2,7 +2,7 @@
|
||||
# file: run_filename
|
||||
# background job to display content of all new files in WATCHDIR
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
@ -2,7 +2,7 @@
|
||||
# file: run_filename
|
||||
# background job to display all new files in WATCHDIR
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
@ -2,7 +2,7 @@
|
||||
# file. multibot.sh
|
||||
# description: run multiple telegram bots from one installation
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
if [ "${2}" = "" ] || [ "${2}" = "-h" ]; then
|
||||
echo "Usage: $0 botname command"
|
||||
|
@ -7,7 +7,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
|
||||
SHELL=/bin/sh
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
@ -1,7 +1,7 @@
|
||||
# file: botacl
|
||||
# a user not listed here, will return false from 'user_is_allowed'
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
# Format:
|
||||
# user:ressource:chat
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
# to show how you can customize bashbot by only editing mycommands.sh
|
||||
# NOTE: this is not tested, simply copied from original source and reworked!
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
#
|
||||
# shellcheck disable=SC2154
|
||||
# shellcheck disable=SC2034
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.70-7-g66c390e
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
#
|
||||
# source from commands.sh to use the aliases
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-3-g9bcab66
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# source from commands.sh if you want ro use interactive or background jobs
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
# This file is public domain in the USA and all free countries.
|
||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||
#
|
||||
#### $$VERSION$$ v0.70-10-gcbdfc7c
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# source from commands.sh to use the inline functions
|
||||
|
||||
@ -31,74 +31,106 @@ answer_inline_multi() {
|
||||
}
|
||||
|
||||
# $1 unique ID for answer
|
||||
# remaining arguments are in the order as shown in telegram doc: https://core.telegram.org/bots/api#inlinequeryresult
|
||||
# $2 type of answer
|
||||
# remaining arguments are the "must have" arguments in the order as in telegram doc
|
||||
# followed by the optional arguments: https://core.telegram.org/bots/api#inlinequeryresult
|
||||
inline_query_compose(){
|
||||
local JSON="{}"
|
||||
local ID="${1}"
|
||||
local title markup caption fours last desc
|
||||
case "${2}" in
|
||||
# user provided media
|
||||
"article")
|
||||
local parse=',"parse_mode":'"${5}" && [ "${5}" = "" ] && parse=""
|
||||
JSON='{"type":"article","id":"'$ID'","title":"'$3'","message_text":"'$4'"'"${parse}"'}'
|
||||
"article"|"message") # article ID title message (markup decription)
|
||||
[ "$5" != "" ] && markup=',"parse_mode":'"$5"
|
||||
[ "$6" != "" ] && desc=',"description":"'$6'"'
|
||||
JSON='{"type":"article","id":"'$ID'","title":"'$3'","message_text":"'$4'"'${markup}${desc}'}'
|
||||
;;
|
||||
"photo")
|
||||
[ "$4" = "" ] && local tumb="$3"
|
||||
JSON='{"type":"photo","id":"'$ID'","photo_url":"'$3'","thumb_url":"'$4${tumb}'"}'
|
||||
"photo") # photo ID photoURL (thumbURL title description caption)
|
||||
[ "$4" = "" ] && tumb="$3"
|
||||
[ "$5" != "" ] && title=',"title":"'$5'"'
|
||||
[ "$6" != "" ] && desc=',"description":"'$6'"'
|
||||
[ "$7" != "" ] && caption=',"caption":"'$7'"'
|
||||
JSON='{"type":"photo","id":"'$ID'","photo_url":"'$3'","thumb_url":"'$4${tumb}'"'${title}${desc}${caption}'}'
|
||||
;;
|
||||
"gif")
|
||||
[ "$4" = "" ] && local tumb="$3"
|
||||
JSON='{"type":"gif","id":"'$ID'","gif_url":"'$3'", "thumb_url":"'$4${tumb}'"}'
|
||||
"gif") # gif ID photoURL (thumbURL title caption)
|
||||
[ "$4" = "" ] && tumb="$3"
|
||||
[ "$5" != "" ] && title=',"title":"'$5'"'
|
||||
[ "$6" != "" ] && caption=',"caption":"'$6'"'
|
||||
JSON='{"type":"gif","id":"'$ID'","gif_url":"'$3'", "thumb_url":"'$4${tumb}'"'${title}${caption}'}'
|
||||
;;
|
||||
"mpeg4_gif")
|
||||
JSON='{"type":"mpeg4_gif","id":"'$ID'","mpeg4_url":"'$3'"}'
|
||||
"mpeg4_gif") # mpeg4_gif ID mpegURL (thumbURL title caption)
|
||||
[ "$4" != "" ] && tumb='","thumb_url":"'$4'"'
|
||||
[ "$5" != "" ] && title=',"title":"'$5'"'
|
||||
[ "$6" != "" ] && caption=',"caption":"'$6'"'
|
||||
JSON='{"type":"mpeg4_gif","id":"'$ID'","mpeg4_url":"'$3'"'${tumb}${title}${caption}'}'
|
||||
;;
|
||||
"video")
|
||||
[ "$5" = "" ] && local tumb="$3"
|
||||
JSON='{"type":"video","id":"'$ID'","video_url":"'$3'","mime_type":"'$4'","thumb_url":"'$5${tumb}'","title":"'$6'"}'
|
||||
"video") # video ID videoURL mime thumbURL title (caption)
|
||||
[ "$7" != "" ] && caption=',"caption":"'$7'"'
|
||||
JSON='{"type":"video","id":"'$ID'","video_url":"'$3'","mime_type":"'$4'","thumb_url":"'$5'","title":"'$6'"'${caption}'}'
|
||||
;;
|
||||
"audio")
|
||||
JSON='{"type":"audio","id":"'$ID'","audio_url":"'$3'","title":"'$4'"}'
|
||||
"audio") # audio ID audioURL title (caption)
|
||||
[ "$5" != "" ] && caption=',"caption":"'$5'"'
|
||||
JSON='{"type":"audio","id":"'$ID'","audio_url":"'$3'","title":"'$4'"'${caption}'}'
|
||||
;;
|
||||
"voice")
|
||||
JSON='{"type":"voice","id":"'$ID'","voice_url":"'$3'","title":"'$4'"}'
|
||||
"voice") # voice ID voiceURL title (caption)
|
||||
[ "$5" != "" ] && caption=',"caption":"'$5'"'
|
||||
JSON='{"type":"voice","id":"'$ID'","voice_url":"'$3'","title":"'$4'"'${caption}'}'
|
||||
;;
|
||||
"document")
|
||||
JSON='{"type":"document","id":"'$ID'","title":"'$3'","caption":"'$4'","document_url":"'$5'","mime_type":"'$6'"}'
|
||||
"document") # document ID title documentURL mimetype (caption description)
|
||||
[ "$6" != "" ] && caption=',"caption":"'$6'"'
|
||||
[ "$7" != "" ] && desc=',"description":"'$7'"'
|
||||
JSON='{"type":"document","id":"'$ID'","title":"'$3'","document_url":"'$4'","mime_type":"'$5'"'${caption}${desc}'}'
|
||||
;;
|
||||
"location")
|
||||
"location") # location ID lat long title
|
||||
JSON='{"type":"location","id":"'$ID'","latitude":"'$3'","longitude":"'$4'","title":"'$5'"}'
|
||||
;;
|
||||
"venue")
|
||||
[ "$6" = "" ] && local addr="$5"
|
||||
JSON='{"type":"venue","id":"'$ID'","latitude":"'$3'","longitude":"'$4'","title":"'$5'","address":"'$6${addr}'"}'
|
||||
"venue") # venue ID lat long title (adress forsquare)
|
||||
[ "$6" = "" ] && addr="$5"
|
||||
[ "$7" != "" ] && fours=',"foursquare_id":"'$7'"'
|
||||
JSON='{"type":"venue","id":"'$ID'","latitude":"'$3'","longitude":"'$4'","title":"'$5'","address":"'$6${addr}'"'${fours}'}'
|
||||
;;
|
||||
"contact")
|
||||
JSON='{"type":"contact","id":"'$ID'","phone_number":"'$3'","first_name":"'$4'","last_name":"'$5'"}'
|
||||
"contact") # contact ID phone first (last thumb)
|
||||
[ "$5" != "" ] && last=',"last_name":"'$5'"'
|
||||
[ "$6" != "" ] && tumb='","thumb_url":"'$6'"'
|
||||
JSON='{"type":"contact","id":"'$ID'","phone_number":"'$3'","first_name":"'$4'"'${last}'"}'
|
||||
;;
|
||||
# Cached media stored in Telegram server
|
||||
"cached_photo")
|
||||
JSON='{"type":"photo","id":"'$ID'","photo_file_id":"'$3'"}'
|
||||
"cached_photo") # photo ID file (title description caption)
|
||||
[ "$4" != "" ] && title=',"title":"'$4'"'
|
||||
[ "$5" != "" ] && desc=',"description":"'$5'"'
|
||||
[ "$6" != "" ] && caption=',"caption":"'$6'"'
|
||||
JSON='{"type":"photo","id":"'$ID'","photo_file_id":"'$3'"'${title}${desc}${caption}'}'
|
||||
;;
|
||||
"cached_gif")
|
||||
JSON='{"type":"gif","id":"'$ID'","gif_file_id":"'$3'"}'
|
||||
"cached_gif") # gif ID file (title caption)
|
||||
[ "$4" != "" ] && title=',"title":"'$4'"'
|
||||
[ "$5" != "" ] && caption=',"caption":"'$5'"'
|
||||
JSON='{"type":"gif","id":"'$ID'","gif_file_id":"'$3'"'${title}${caption}'}'
|
||||
;;
|
||||
"cached_mpeg4_gif")
|
||||
JSON='{"type":"mpeg4_gif","id":"'$ID'","mpeg4_file_id":"'$3'"}'
|
||||
"cached_mpeg4_gif") # mpeg ID file (title caption)
|
||||
[ "$4" != "" ] && title=',"title":"'$4'"'
|
||||
[ "$5" != "" ] && caption=',"caption":"'$5'"'
|
||||
JSON='{"type":"mpeg4_gif","id":"'$ID'","mpeg4_file_id":"'$3'"'${title}${caption}'}'
|
||||
;;
|
||||
"cached_sticker")
|
||||
"cached_sticker") # sticker ID file
|
||||
JSON='{"type":"sticker","id":"'$ID'","sticker_file_id":"'$3'"}'
|
||||
;;
|
||||
"cached_document")
|
||||
JSON='{"type":"document","id":"'$ID'","title":"'$3'","document_file_id":"'$4'"}'
|
||||
"cached_document") # document ID title file (description caption)
|
||||
[ "$5" != "" ] && desc=',"description":"'$5'"'
|
||||
[ "$6" != "" ] && caption=',"caption":"'$6'"'
|
||||
JSON='{"type":"document","id":"'$ID'","title":"'$3'","document_file_id":"'$4'"'${desc}${caption}'}'
|
||||
;;
|
||||
"cached_video")
|
||||
JSON='{"type":"video","id":"'$ID'","video_file_id":"'$3'","title":"'$4'"}'
|
||||
"cached_video") # video ID file title (description caption)
|
||||
[ "$5" != "" ] && desc=',"description":"'$5'"'
|
||||
[ "$6" != "" ] && caption=',"caption":"'$6'"'
|
||||
JSON='{"type":"video","id":"'$ID'","video_file_id":"'$3'","title":"'$4'"'${desc}${caption}'}'
|
||||
;;
|
||||
"cached_voice")
|
||||
JSON='{"type":"voice","id":"'$ID'","voice_file_id":"'$3'","title":"'$4'"}'
|
||||
"cached_voice") # voice ID file title (caption)
|
||||
[ "$5" != "" ] && caption=',"caption":"'$5'"'
|
||||
JSON='{"type":"voice","id":"'$ID'","voice_file_id":"'$3'","title":"'$4'"'${caption}'}'
|
||||
;;
|
||||
"cached_audio")
|
||||
JSON='{"type":"audio","id":"'$ID'","audio_file_id":"'$3'"}'
|
||||
"cached_audio") # audio ID file title (caption)
|
||||
[ "$5" != "" ] && caption=',"caption":"'$5'"'
|
||||
JSON='{"type":"audio","id":"'$ID'","audio_file_id":"'$3'"'${caption}'}'
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# files: mycommands.sh.dist
|
||||
# copy to mycommands.sh and add all your commands and functions here ...
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-3-g9bcab66
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
#
|
||||
# shellcheck disable=SC2154
|
||||
# shellcheck disable=SC2034
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# ADD a new test skeleton to test dir, but does not activate test
|
||||
#
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# magic to ensure that we're always inside the root of our application,
|
||||
# no matter from which directory we'll run script
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# common variables
|
||||
export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
../dev/hooks/pre-commit.sh
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# file: b-example-test.sh
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.70-6-g5b8f2a2
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#### $$VERSION$$ v0.80-dev-2-g4e4194d
|
||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
||||
|
||||
# include common functions and definitions
|
||||
# shellcheck source=test/ALL-tests.inc.sh
|
||||
|
Loading…
Reference in New Issue
Block a user