mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-22 07:25:10 +00:00
Version 0.60 of bashbot
This commit is contained in:
parent
f5162e2616
commit
209c4b34f4
16
README.md
16
README.md
@ -12,7 +12,7 @@ Elsewhere, consider it released under the [WTFPLv2](http://www.wtfpl.net/txt/cop
|
||||
Depends on [tmux](http://github.com/tmux/tmux).
|
||||
Uses [JSON.sh](http://github.com/dominictarr/JSON.sh).
|
||||
|
||||
For full UTF-8 support you need [python on your system](doc/4_expert.md#UTF-8-Support) (optional).
|
||||
Most complete [UTF-8 support for bashbot](doc/4_expert.md#Bashbot-UTF-8-Support) is availible if phyton is installed (optional).
|
||||
|
||||
Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Downloads](https://github.com/topkecleon/telegram-bot-bash/releases) are availible on www.github.com
|
||||
|
||||
@ -57,14 +57,16 @@ Bashbot [Documentation](https://github.com/topkecleon/telegram-bot-bash) and [Do
|
||||
From Version 0.60 on keybord format for ```send_keyboard``` and ```send_message "mykeyboardstartshere ..."``` was changed.
|
||||
Keybords are now defined in JSON Array notation e.g. "[ \\"yes\\" , \\"no\\" ]".
|
||||
This has the advantage that you can create any type of keyboard supported by Telegram.
|
||||
The old format is supported for backward compatibility, but may fail for strange corner cases.
|
||||
The old format is supported for backward compatibility, but may fail for corner cases.
|
||||
|
||||
*Example Keyboards*:
|
||||
|
||||
- OLD format: 'yes' 'no' (two strings)
|
||||
- NEW format: '[ "yes" , "no" ]' (string containing an array)
|
||||
- new keybord layouts, not possible with old format:
|
||||
- Yes No in two rows: '[ "yes" ] , [ "no" ]'
|
||||
- yes no in two rows:
|
||||
- OLD format: 'yes' 'no' (two strings)
|
||||
- NEW format: '[ "yes" ] , [ "no" ]' (two arrays with a string)
|
||||
- new layouts made easy with NEW format:
|
||||
- Yes No in one row: '[ "yes" , "no" ]'
|
||||
- Yes No plus Maybe in 2.row: '[ "yes" , "no" ] , [ "maybe" ]'
|
||||
- numpad style keyboard: '[ "1" , "2" , "3" ] , [ "4" , "5" , "6" ] , [ "7" , "8" , "9" ] , [ "0" ]'
|
||||
|
||||
## Security Considerations
|
||||
@ -97,4 +99,4 @@ Bashbot is not more (in)secure as any other Bot written in any other language, w
|
||||
|
||||
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
|
||||
|
||||
#### $$VERSION$$ v0.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
16
README.txt
16
README.txt
@ -80,14 +80,16 @@ From Version 0.60 on keybord format for `send_keyboard` and
|
||||
defined in JSON Array notation e.g. "[ \"yes\" , \"no\" ]". This has the
|
||||
advantage that you can create any type of keyboard supported by
|
||||
Telegram. The old format is supported for backward compatibility, but
|
||||
may fail for strange corner cases.
|
||||
may fail for corner cases.
|
||||
|
||||
_Example Keyboards_:
|
||||
|
||||
* OLD format: 'yes' 'no' (two strings)
|
||||
* NEW format: '[ "yes" , "no" ]' (string containing an array)
|
||||
* new keybord layouts, not possible with old format:
|
||||
** Yes No in two rows: '[ "yes" ] , [ "no" ]'
|
||||
* yes no in two rows:
|
||||
** OLD format: 'yes' 'no' (two strings)
|
||||
** NEW format: '[ "yes" ] , [ "no" ]' (two arrays with a string)
|
||||
* new layouts made easy with NEW format:
|
||||
** Yes No in one row: '[ "yes" , "no" ]'
|
||||
** Yes No plus Maybe in 2.row: '[ "yes" , "no" ] , [ "maybe" ]'
|
||||
** numpad style keyboard: '[ "1" , "2" , "3" ] , [ "4" , "5" , "6" ] , [
|
||||
"7" , "8" , "9" ] , [ "0" ]'
|
||||
|
||||
@ -159,5 +161,5 @@ That's it!
|
||||
If you feel that there's something missing or if you found a bug, feel
|
||||
free to submit a pull request!
|
||||
|
||||
latexmath:[\[VERSION\]] v0.60-rc3-0-g19a0f7e
|
||||
++++++++++++++++++++++++++++++++++++++++++++
|
||||
latexmath:[\[VERSION\]] v0.60-0-gf5162e2
|
||||
++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -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.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
|
||||
SHELL=/bin/sh
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# description: Start or stop telegram-bash-bot
|
||||
#
|
||||
#### $$VERSION$$ v0.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
# shellcheck disable=SC2009
|
||||
# shellcheck disable=SC2181
|
||||
|
||||
|
@ -10,7 +10,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.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
#
|
||||
# Exit Codes:
|
||||
# - 0 sucess (hopefully)
|
||||
|
2
calc
2
calc
@ -3,7 +3,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.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
# 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.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
#
|
||||
# shellcheck disable=SC2154
|
||||
# shellcheck disable=SC2034
|
||||
|
@ -61,5 +61,5 @@ group. This step is up to you actually.
|
||||
|
||||
#### [Next Getting started](2_usage.md)
|
||||
|
||||
#### $$VERSION$$ v0.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
|
@ -159,5 +159,5 @@ send_action "${CHAT[ID]}" "action"
|
||||
#### [Prev Create Bot](1_firstbot.md)
|
||||
#### [Next Advanced Usage](3_advanced.md)
|
||||
|
||||
#### $$VERSION$$ v0.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
|
@ -156,5 +156,5 @@ answer_inline_query "$iQUERY_ID" "cached_sticker" "identifier for the sticker"
|
||||
#### [Prev Advanced Usage](3_advanced.md)
|
||||
#### [Next Expert Use](4_expert.md)
|
||||
|
||||
#### $$VERSION$$ v0.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
|
@ -37,7 +37,7 @@ export 'LANGUAGE=den_US.UTF-8'
|
||||
|
||||
To display all availible locales on your system run ```locale -a | more```. [Gentoo Wiki](https://wiki.gentoo.org/wiki/UTF-8)
|
||||
|
||||
#### Bashbot's UTF-8 Support
|
||||
#### Bashbot UTF-8 Support
|
||||
Bashbot handles all messages transparently, regardless of the charset in use. The only exception is when converting from JSON data to strings.
|
||||
|
||||
Telegram use JSON to send / recieve data. JSON encodes strings as follow: Characters not ASCII *(>127)* are escaped as sequences of ```\uxxxx``` to be regular ASCII. In addition multibyte characters, *e.g. Emoticons or Arabic characters*, are send in double byte UTF-16 notation.
|
||||
@ -45,8 +45,8 @@ The Emoticons ``` 😁 😘 ❤️ 😊 👍 ``` are encoded as: ``` \uD83D\uDE0
|
||||
|
||||
**This "mixed" JSON encoding needs special handling and can not decoded from** ```echo -e``` or ```printf '%s\\n'```
|
||||
|
||||
To to fully support decoding of multibyte characters you need a working python2 installation on your system.
|
||||
If no python is detected bashbot falls back to a **internal pure bash implementaion which may not work for some corner cases**.
|
||||
Most complete support for decoding of multibyte characters can only be provided if python is installed on your system.
|
||||
**Without phyton bashbot falls back to an internal, pure bash implementation which may not work for some corner cases**.
|
||||
|
||||
|
||||
### Run as other user or system service
|
||||
@ -104,5 +104,5 @@ An example crontab is provided in ```bashbot.cron```.
|
||||
#### [Prev Expert Use](4_expert.md)
|
||||
#### [Next Best Practice](5_practice.md)
|
||||
|
||||
#### $$VERSION$$ v0.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
|
@ -112,5 +112,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.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
|
@ -117,13 +117,14 @@ send_file "${CHAT[ID]}" "https://www.domain,com/something.gif" "Something"
|
||||
##### send_keyboard
|
||||
Note: since version 0.6 send_keyboard was changed to use native "JSON Array" notation as used from Telegram. Example Keybord Array definitions:
|
||||
|
||||
- OLD format: 'yes' 'no' (two strings)
|
||||
- NEW format: '[ "yes" , "no" ]' (string containing an array)
|
||||
- new keybord layouts, not possible with old format:
|
||||
- Yes No in two rows: '[ "yes" ] , [ "no" ]'
|
||||
- yes no in two rows:
|
||||
- OLD format: 'yes' 'no' (two strings)
|
||||
- NEW format: '[ "yes" ] , [ "no" ]' (two arrays with a string)
|
||||
- new layouts made easy with NEW format:
|
||||
- Yes No in one row: '[ "yes" , "no" ]'
|
||||
- Yes No plus Maybe in 2.row: '[ "yes" , "no" ] , [ "maybe" ]'
|
||||
- numpad style keyboard: '[ "1" , "2" , "3" ] , [ "4" , "5" , "6" ] , [ "7" , "8" , "9" ] , [ "0" ]'
|
||||
|
||||
|
||||
*usage:* send_keyboard "chat-id" "message" "keyboard"
|
||||
|
||||
*example:*
|
||||
@ -346,5 +347,5 @@ Send Input from Telegram to waiting Interactive Chat.
|
||||
|
||||
#### [Prev Best Practice](5_practice.md)
|
||||
|
||||
#### $$VERSION$$ v0.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
|
2
notify
2
notify
@ -2,7 +2,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.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
2
question
2
question
@ -3,7 +3,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.60-rc3-0-g19a0f7e
|
||||
#### $$VERSION$$ v0.60-0-gf5162e2
|
||||
|
||||
# adjust your language setting here
|
||||
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment
|
||||
|
Loading…
Reference in New Issue
Block a user