mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-28 18:26:28 +00:00
Bashbot Version 0.72
This commit is contained in:
parent
e89942074a
commit
67c47ac785
@ -103,6 +103,6 @@
|
|||||||
<p><span class="citation">@Gnadelwartz</span></p>
|
<p><span class="citation">@Gnadelwartz</span></p>
|
||||||
<h2 id="thats-it">That’s it!</h2>
|
<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>
|
<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.72-dev-5-g73b7734"><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-5-g73b7734</h4>
|
<h4 id="version-v0.72-0-ge899420"><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-0-ge899420</h4>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -98,4 +98,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!
|
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-5-g73b7734
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
@ -137,4 +137,4 @@ health status
|
|||||||
If you feel that there's something missing or if you found a bug, feel free to
|
If you feel that there's something missing or if you found a bug, feel free to
|
||||||
submit a pull request!
|
submit a pull request!
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-5-g73b7734
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# description: Start or stop telegram-bash-bot
|
# description: Start or stop telegram-bash-bot
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
# shellcheck disable=SC2009
|
# shellcheck disable=SC2009
|
||||||
# shellcheck disable=SC2181
|
# shellcheck disable=SC2181
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-4-gbf00d33
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 sucess (hopefully)
|
# - 0 sucess (hopefully)
|
||||||
@ -498,7 +498,7 @@ start_bot() {
|
|||||||
local addsleep="100"
|
local addsleep="100"
|
||||||
local maxsleep="$(( ${BASHBOT_SLEEP:-5000} + 100 ))"
|
local maxsleep="$(( ${BASHBOT_SLEEP:-5000} + 100 ))"
|
||||||
[[ "${DEBUG}" = *"debug" ]] && exec &>>"DEBUG.log"
|
[[ "${DEBUG}" = *"debug" ]] && exec &>>"DEBUG.log"
|
||||||
[ "${DEBUG}" != "" ] && date && echo "Start BASHBOT in Mode ${DEBUG}"
|
[ "${DEBUG}" != "" ] && date && echo "Start BASHBOT in Mode \"${DEBUG}\""
|
||||||
[[ "${DEBUG}" = "xdebug"* ]] && set -x
|
[[ "${DEBUG}" = "xdebug"* ]] && set -x
|
||||||
while true; do {
|
while true; do {
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-3-g65b32aa
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
#
|
#
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# this has to run once atfer git clone
|
# this has to run once atfer git clone
|
||||||
# and every time we create new hooks
|
# and every time we create new hooks
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# magic to ensure that we're always inside the root of our application,
|
# magic to ensure that we're always inside the root of our application,
|
||||||
# no matter from which directory we'll run script
|
# 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
|
# works together with git pre-push.sh and ADD all changed files since last push
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# magic to ensure that we're always inside the root of our application,
|
# magic to ensure that we're always inside the root of our application,
|
||||||
# no matter from which directory we'll run script
|
# no matter from which directory we'll run script
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
############
|
############
|
||||||
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
############
|
############
|
||||||
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
# NOTE: you MUST run install-hooks.sh again when updating this file!
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# this has to run once atfer git clone
|
# this has to run once atfer git clone
|
||||||
# and every time we create new hooks
|
# and every time we create new hooks
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# magic to ensure that we're always inside the root of our application,
|
# magic to ensure that we're always inside the root of our application,
|
||||||
# no matter from which directory we'll run script
|
# no matter from which directory we'll run script
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# this has to run once atfer git clone
|
# this has to run once atfer git clone
|
||||||
# and every time we create new hooks
|
# and every time we create new hooks
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# magic to ensure that we're always inside the root of our application,
|
# magic to ensure that we're always inside the root of our application,
|
||||||
# no matter from which directory we'll run script
|
# no matter from which directory we'll run script
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# list of additional files to check from shellcheck
|
# list of additional files to check from shellcheck
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
bashbot.rc
|
bashbot.rc
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
#
|
#
|
||||||
# Easy Versioning in git:
|
# 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)
|
#### [Next Create Bot](1_firstbot.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -65,5 +65,5 @@ group. This step is up to you actually.
|
|||||||
#### [Prev Installation](0_install.md)
|
#### [Prev Installation](0_install.md)
|
||||||
#### [Next Getting started](2_usage.md)
|
#### [Next Getting started](2_usage.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -182,5 +182,5 @@ send_action "${CHAT[ID]}" "action"
|
|||||||
#### [Prev Create Bot](1_firstbot.md)
|
#### [Prev Create Bot](1_firstbot.md)
|
||||||
#### [Next Advanced Usage](3_advanced.md)
|
#### [Next Advanced Usage](3_advanced.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-4-gbf00d33
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -178,5 +178,5 @@ answer_inline_query "${iQUERY[ID]}" "cached_sticker" "identifier for the sticker
|
|||||||
#### [Prev Getting started](2_usage.md)
|
#### [Prev Getting started](2_usage.md)
|
||||||
#### [Next Expert Use](4_expert.md)
|
#### [Next Expert Use](4_expert.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -104,5 +104,5 @@ An example crontab is provided in ```examples/bashbot.cron```.
|
|||||||
#### [Prev Expert Use](4_expert.md)
|
#### [Prev Expert Use](4_expert.md)
|
||||||
#### [Next Best Practice](5_practice.md)
|
#### [Next Best Practice](5_practice.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -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)
|
#### [Prev Best Practice](5_practice.md)
|
||||||
#### [Next Functions Reference](6_reference.md)
|
#### [Next Functions Reference](6_reference.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -592,5 +592,5 @@ Send Input from Telegram to waiting Interactive Chat.
|
|||||||
#### [Prev Best Practice](5_practice.md)
|
#### [Prev Best Practice](5_practice.md)
|
||||||
#### [Next Notes for Developers](7_develop.md)
|
#### [Next Notes for Developers](7_develop.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-5-g73b7734
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -131,5 +131,5 @@ fi
|
|||||||
#### [Prev Function Reference](6_reference.md)
|
#### [Prev Function Reference](6_reference.md)
|
||||||
#### [Next Bashbot Environment](8_custom.md)
|
#### [Next Bashbot Environment](8_custom.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-5-g73b7734
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -117,5 +117,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms.
|
|||||||
|
|
||||||
#### [Prev Notes for Developers](7_develop.md)
|
#### [Prev Notes for Developers](7_develop.md)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
@ -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.
|
**external-use** will contain some examples on how to send messages from external scripts to Telegram chats or users.
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# file: run_filename
|
# file: run_filename
|
||||||
# background job to display content of all new files in WATCHDIR
|
# background job to display content of all new files in WATCHDIR
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# file: run_filename
|
# file: run_filename
|
||||||
# background job to display all new files in WATCHDIR
|
# background job to display all new files in WATCHDIR
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# 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.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# file. multibot.sh
|
# file. multibot.sh
|
||||||
# description: run multiple telegram bots from one installation
|
# description: run multiple telegram bots from one installation
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
if [ "${2}" = "" ] || [ "${2}" = "-h" ]; then
|
if [ "${2}" = "" ] || [ "${2}" = "-h" ]; then
|
||||||
echo "Usage: $0 botname command"
|
echo "Usage: $0 botname command"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
SHELL=/bin/sh
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# 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.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# 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.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
|
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# adjust your language setting here
|
# adjust your language setting here
|
||||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# file: botacl
|
# file: botacl
|
||||||
# a user not listed here, will return false from 'user_is_allowed'
|
# a user not listed here, will return false from 'user_is_allowed'
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
# Format:
|
# Format:
|
||||||
# user:ressource:chat
|
# user:ressource:chat
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# to show how you can customize bashbot by only editing mycommands.sh
|
# to show how you can customize bashbot by only editing mycommands.sh
|
||||||
# NOTE: this is not tested, simply copied from original source and reworked!
|
# NOTE: this is not tested, simply copied from original source and reworked!
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
#
|
#
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-3-g65b32aa
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
#
|
#
|
||||||
# source from commands.sh to use the aliases
|
# source from commands.sh to use the aliases
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-3-g65b32aa
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# source from commands.sh if you want ro use interactive or background jobs
|
# 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.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-3-g65b32aa
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# source from commands.sh to use the inline functions
|
# source from commands.sh to use the inline functions
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ inline_query_compose(){
|
|||||||
case "${2}" in
|
case "${2}" in
|
||||||
# user provided media
|
# user provided media
|
||||||
"article"|"message") # article ID title message (markup decription)
|
"article"|"message") # article ID title message (markup decription)
|
||||||
JSON='{"type":"article","id":"'$ID'","message_text":"'$4'"'$(title2Json "$3" "" "$5" "$6")'}'
|
JSON='{"type":"article","id":"'$ID'","input_message_content": {"message_text":"'$4'"} '$(title2Json "$3" "" "$5" "$6")'}'
|
||||||
;;
|
;;
|
||||||
"photo") # photo ID photoURL (thumbURL title description caption)
|
"photo") # photo ID photoURL (thumbURL title description caption)
|
||||||
[ "$4" = "" ] && tumb="$3"
|
[ "$4" = "" ] && tumb="$3"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# files: mycommands.sh.dist
|
# files: mycommands.sh.dist
|
||||||
# copy to mycommands.sh and add all your commands and functions here ...
|
# copy to mycommands.sh and add all your commands and functions here ...
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-7-ga734b5f
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
#
|
#
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
@ -62,21 +62,35 @@ else
|
|||||||
|
|
||||||
myinlines() {
|
myinlines() {
|
||||||
#######################
|
#######################
|
||||||
# Inline query examples
|
# Inline query examples, do not use them in production (exept image search ;-)
|
||||||
# shellcheck disable=SC2128
|
# shellcheck disable=SC2128
|
||||||
case "${iQUERY}" in
|
case "${iQUERY}" in
|
||||||
"image "*) # search in yahoo images
|
"image "*) # search images with yahoo
|
||||||
local search="${iQUERY#* }"
|
local search="${iQUERY#* }"
|
||||||
answer_inline_multi "${iQUERY[ID]}" "$(my_image_search "${search}")"
|
answer_inline_multi "${iQUERY[ID]}" "$(my_image_search "${search}")"
|
||||||
;;
|
;;
|
||||||
"photo") # manually provide URLs
|
|
||||||
|
"0"*) # a single message with title
|
||||||
|
answer_inline_query "${iQUERY[ID]}" "message" "Title of the result" "Content of the message to be sent"
|
||||||
|
;;
|
||||||
|
"1"*) # a single photo
|
||||||
|
answer_inline_query "${iQUERY[ID]}" "photo" "https://avatars.githubusercontent.com/u/13046303" "https://avatars.githubusercontent.com/u/13046303"
|
||||||
|
;;
|
||||||
|
"2"*) # two photos
|
||||||
answer_inline_multi "${iQUERY[ID]}" "
|
answer_inline_multi "${iQUERY[ID]}" "
|
||||||
$(inline_query_compose "$RANDOM" "photo" "https://avatars.githubusercontent.com/u/13046303"),
|
$(inline_query_compose "$RANDOM" "photo" "https://avatars.githubusercontent.com/u/13046303"),
|
||||||
$(inline_query_compose "$RANDOM" "photo" "https://avatars.githubusercontent.com/u/4593242")
|
$(inline_query_compose "$RANDOM" "photo" "https://avatars.githubusercontent.com/u/4593242")
|
||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
|
"3"*) # three photos
|
||||||
|
answer_inline_multi "${iQUERY[ID]}" "
|
||||||
|
$(inline_query_compose "$RANDOM" "photo" "https://avatars.githubusercontent.com/u/13046303"),
|
||||||
|
$(inline_query_compose "$RANDOM" "photo" "https://avatars.githubusercontent.com/u/4593242")
|
||||||
|
$(inline_query_compose "$RANDOM" "photo" "https://avatars.githubusercontent.com/u/102707")
|
||||||
|
"
|
||||||
|
;;
|
||||||
|
|
||||||
"avatar") # read URLS from array
|
"4") # four photo from array
|
||||||
local sep=""
|
local sep=""
|
||||||
local avatar=("https://avatars.githubusercontent.com/u/13046303" "https://avatars.githubusercontent.com/u/4593242" "https://avatars.githubusercontent.com/u/102707" "https://avatars.githubusercontent.com/u/6460407")
|
local avatar=("https://avatars.githubusercontent.com/u/13046303" "https://avatars.githubusercontent.com/u/4593242" "https://avatars.githubusercontent.com/u/102707" "https://avatars.githubusercontent.com/u/6460407")
|
||||||
answer_inline_multi "${iQUERY[ID]}" "
|
answer_inline_multi "${iQUERY[ID]}" "
|
||||||
@ -86,15 +100,12 @@ else
|
|||||||
"
|
"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"sticker")
|
"sticker") # example chaecd telegram sticker
|
||||||
answer_inline_query "${iQUERY[ID]}" "cached_sticker" "BQADBAAD_QEAAiSFLwABWSYyiuj-g4AC"
|
answer_inline_query "${iQUERY[ID]}" "cached_sticker" "BQADBAAD_QEAAiSFLwABWSYyiuj-g4AC"
|
||||||
;;
|
;;
|
||||||
"gif")
|
"gif") # exmaple chaehed gif
|
||||||
answer_inline_query "${iQUERY[ID]}" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC"
|
answer_inline_query "${iQUERY[ID]}" "cached_gif" "BQADBAADIwYAAmwsDAABlIia56QGP0YC"
|
||||||
;;
|
;;
|
||||||
"web")
|
|
||||||
answer_inline_query "${iQUERY[ID]}" "article" "GitHub" "http://github.com/topkecleon/telegram-bot-bash"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# ADD a new test skeleton to test dir, but does not activate test
|
# ADD a new test skeleton to test dir, but does not activate test
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# magic to ensure that we're always inside the root of our application,
|
# magic to ensure that we're always inside the root of our application,
|
||||||
# no matter from which directory we'll run script
|
# no matter from which directory we'll run script
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# common variables
|
# common variables
|
||||||
export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME
|
export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
../dev/hooks/pre-commit.sh
|
../dev/hooks/pre-commit.sh
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# file: b-example-test.sh
|
# file: b-example-test.sh
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ v0.72-dev-0-g6afa177
|
#### $$VERSION$$ v0.72-0-ge899420
|
||||||
|
|
||||||
# include common functions and definitions
|
# include common functions and definitions
|
||||||
# shellcheck source=test/ALL-tests.inc.sh
|
# shellcheck source=test/ALL-tests.inc.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user