Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.2 #161

Merged
merged 100 commits into from
Dec 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
b4dcb52
allow enabling of getJson update logging
gnadelwartz Nov 29, 2020
a1773cc
document enabling update logging
gnadelwartz Nov 29, 2020
b5caff0
statisfy newer shellcheck version
gnadelwarty Nov 29, 2020
11c1d55
bc and codespell are optional
gnadelwarty Nov 29, 2020
2824487
fix BASHBOT_UPDATELOG
gnadelwarty Nov 29, 2020
95b2b9a
detect if no curl AND no wget
gnadelwartz Nov 29, 2020
ef80aa5
better curl/wget not found message
gnadelwartz Nov 29, 2020
aac3ddf
fix make-dist
gnadelwartz Nov 29, 2020
c50499c
remove unwanted comments from standalone scripts
gnadelwartz Nov 30, 2020
d30a700
change Version to v1.2
gnadelwartz Nov 30, 2020
1b8a1d4
get/save botid, new function bot_is_admin
gnadelwartz Dec 3, 2020
b0281f1
fix bot_is_admin
gnadelwartz Dec 3, 2020
40106ee
offer to check bottoken online on first init
gnadelwartz Dec 3, 2020
658fac6
fix .jssh files in gitignore
gnadelwartz Dec 3, 2020
59c51af
default to nobody
gnadelwartz Dec 3, 2020
d6e1c22
optimize getBotName
gnadelwartz Dec 3, 2020
04ec4ba
fix test with existing config
gnadelwartz Dec 4, 2020
62cab32
bottoken starts with bot id
gnadelwartz Dec 5, 2020
10c104d
check for locale C
gnadelwartz Dec 7, 2020
5db2ef6
add BOTSENT[ID] to documentation
gnadelwartz Dec 7, 2020
336f00b
fix BOTSENT spelling
gnadelwartz Dec 7, 2020
b9cfd4b
process service messages in groups only
gnadelwartz Dec 13, 2020
401a31a
less grep in process_message
gnadelwartz Dec 13, 2020
cdb63b8
optimze venue and contact detection
gnadelwartz Dec 13, 2020
22741d9
fix no need for JsonDecode
gnadelwartz Dec 13, 2020
da7a3f1
detect supergroup migration
gnadelwartz Dec 13, 2020
eda77f8
add /_migrate_group to mycommands.sh example
gnadelwartz Dec 13, 2020
975d014
remove old workaround preventing interactive to work
gnadelwartz Dec 13, 2020
931598f
check interactive working ...
gnadelwartz Dec 13, 2020
898a794
prepare for editMessage
gnadelwartz Dec 13, 2020
4f600e2
first editMessage implementation
gnadelwartz Dec 13, 2020
a25f876
fix editMessage parameter desc
gnadelwartz Dec 13, 2020
da7b1bc
fix misst quotaion mark in _formated_message_url
gnadelwartz Dec 13, 2020
c8f61af
fix misspelled internal function
gnadelwartz Dec 13, 2020
78ddc1f
add edit_message documentation
gnadelwartz Dec 13, 2020
3496a21
fix edit_message documentation
gnadelwartz Dec 13, 2020
3c1ea93
try recover from block in update loop
gnadelwartz Dec 14, 2020
dfe9c7e
adjust messages in commands.sh
gnadelwartz Dec 14, 2020
84b893c
adjust messages in commands.sh
gnadelwartz Dec 14, 2020
5ca6afc
start using markdown v2 in mycommands
gnadelwartz Dec 14, 2020
d1f2bc8
escape more reserved characters for markdown v2
gnadelwartz Dec 14, 2020
4442382
option to ignore commands for other bots if admin
gnadelwartz Dec 14, 2020
2e24918
debug log sentMessage also
gnadelwartz Dec 15, 2020
8379a62
sendJson check chat is a number
gnadelwartz Dec 15, 2020
d7d61a4
sendJson: factor out curl/wget, better log. fix git-add.sh
gnadelwartz Dec 15, 2020
c084005
add support for JSON.awk, 5 times faster
gnadelwartz Dec 15, 2020
9d39fe1
JSON.awk documentation
gnadelwartz Dec 15, 2020
32a6ef2
try to avoid empty DEBUG.log file
gnadelwartz Dec 15, 2020
5b94265
optimize logging
gnadelwartz Dec 15, 2020
85ee757
fix some update messages are ignored
gnadelwartz Dec 15, 2020
e6223b6
start of ready to use scripts
gnadelwartz Dec 16, 2020
16448a9
factor out broadcast command
gnadelwartz Dec 16, 2020
f762d22
fix: jssjDB path must not contain more than one ..
gnadelwartz Dec 16, 2020
1dd546b
add bin directory to distribution
gnadelwartz Dec 16, 2020
c356143
fix scripts BASHBOT_HOME
gnadelwartz Dec 17, 2020
16a2299
remove nashbot option broadcast, use broadcast.sh
gnadelwartz Dec 17, 2020
8b9cb1a
remove set -x
gnadelwartz Dec 17, 2020
53c7879
add error respone for chat id not a nuber
gnadelwartz Dec 18, 2020
0db0215
fix sendJsonResult and chat is not a number
gnadelwartz Dec 18, 2020
bd155f8
add bin/bashbot_env.inc.sh
gnadelwartz Dec 18, 2020
3324ecd
fix log sendJson
gnadelwartz Dec 18, 2020
c88f767
optimize creation of botconfig
gnadelwartz Dec 18, 2020
62f2a0d
fix recover botconfig
gnadelwartz Dec 18, 2020
f43fb72
always create fresh zip/tar without unwanted files
gnadelwartz Dec 18, 2020
f548b0e
fix DETECTED_CURL
gnadelwartz Dec 19, 2020
873169b
fix exclude files from everywhere
gnadelwartz Dec 19, 2020
82f7939
remove deprecated commands
gnadelwartz Dec 19, 2020
9c319f8
update jsshDB-keyboard example
gnadelwartz Dec 19, 2020
0d50c8d
better JSON.awk instructions
gnadelwartz Dec 19, 2020
f56b7ae
always patch JSON.awk
gnadelwartz Dec 23, 2020
cecc39f
inject and patch JSON.awk for DIST
gnadelwartz Dec 23, 2020
05bb23a
shorter urls for download
gnadelwartz Dec 23, 2020
20bfef1
doc: JSON.awk now in zip / tar
gnadelwartz Dec 23, 2020
ac877c2
bin/send_edit_message
gnadelwartz Dec 23, 2020
fffa436
fix bin help messages
gnadelwartz Dec 23, 2020
4a4f73b
bin/bashbot_stats.sh
gnadelwartz Dec 23, 2020
9f3d39d
stats deprecated
gnadelwartz Dec 23, 2020
928ab05
fix source debug
gnadelwartz Dec 23, 2020
4d1c237
fix stats help
gnadelwartz Dec 23, 2020
824cf13
fix test for missing unicode supprt
gnadelwartz Dec 24, 2020
450d94d
check for utf-8 locale
gnadelwartz Dec 24, 2020
eba9216
remove stats from usage
gnadelwartz Dec 24, 2020
fa24673
prefix standalone scripts with bin
gnadelwartz Dec 24, 2020
69ca15a
better broadcast hint
gnadelwartz Dec 24, 2020
f4d64f7
add post-commit hook
gnadelwartz Dec 24, 2020
a9852ef
use last commit date in git-add
gnadelwartz Dec 24, 2020
c93c9ae
doc: add bin/ scripts
gnadelwartz Dec 24, 2020
6173d77
type -t is locale indepent, use C.utf-8 for printf
gnadelwartz Dec 24, 2020
c39c1ca
file caption does not support \n
gnadelwartz Dec 24, 2020
709e26b
\n part 2
gnadelwartz Dec 24, 2020
1dd9441
doc: add bin/ scripts usage
gnadelwartz Dec 25, 2020
dca7a6d
doc: add usage of \n
gnadelwartz Dec 25, 2020
269cbfb
doc: send_text_messge -> send_normal_message
gnadelwartz Dec 25, 2020
f281ae0
add check and use of BOTADMIN in bin/ scripts
gnadelwartz Dec 25, 2020
0b7cd8a
move BOTADMIN check to bashbot_env.inc
gnadelwartz Dec 25, 2020
f016598
get BOT_ADMIN and BOT_NAME in bin/bashbot_env.inc
gnadelwartz Dec 25, 2020
ffc1ecf
export BASHBOT_HOME _ETC _VAR in bin/bashbot_env.inc
gnadelwartz Dec 25, 2020
88d1de2
fix bashbot tests
gnadelwartz Dec 25, 2020
2ab00a2
add bin/send_file.sh, fix logging caption
gnadelwartz Dec 25, 2020
239dd76
Version 1.20
gnadelwartz Dec 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/botconf*
/botacl*
/botown*
ˆ.jssh
*.jssh
*.save
*.log
*.swp
Expand Down
215 changes: 173 additions & 42 deletions README.html

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,16 @@ you shouldn't use echo to display it. [Use printf whenever possible](https://uni
# very simple
echo "text with variables. PWD=$PWD"
printf '%s\n' "text with variables. PWD=$PWD"
printf 'text with variables. PWD=%s\n' "$PWD"
-> text with variables. PWD=/home/xxx

# more advanced
FLOAT="1.2346777892864" INTEGER="12345.123"
echo "text with variabeles. float=$FLOAT, integer=$INTEGER, PWD=$PWD"
->text with variables. float=1.2346777892864, integer=12345.123, PWD=/home/xxx
echo "float=$FLOAT, integer=$INTEGER, PWD=$PWD"
-> float=1.2346777892864, integer=12345.123, PWD=/home/xxx

printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "" "$INTEGER" "$PWD"
->text with variables. float=1.23, integer=12345, PWD=/home/xxx
printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "$FLOAT" "$INTEGER" "$PWD"
-> float=1.23, integer=12345, PWD=/home/xxx
```

### Do not use #!/usr/bin/env bash
Expand Down Expand Up @@ -238,6 +239,9 @@ curl -m 10 https://api.telegram.org/bot

wget -t 1 -T 10 https://api.telegram.org/bot
#Connecting to api.telegram.org (api.telegram.org)|46.38.243.234|:443... failed: Connection timed out.

nc -w 2 api.telegram.org 443 || echo "your IP seems blocked by telegram"
#your IP seems blocked by telegram
```

Since Version 0.96 bashbot offers the option to recover from broken connections (aka blocked). Therefore you can provide a function
Expand Down Expand Up @@ -265,4 +269,4 @@ bashbotBlockRecover() {

If you feel that there's something missing or if you found a bug, feel free to submit a pull request!

#### $$VERSION$$ v1.1-0-ge835bbc
#### $$VERSION$$ v1.20-0-g2ab00a2
16 changes: 10 additions & 6 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,17 @@ possible](https://unix.stackexchange.com/a/6581)
# very simple
echo "text with variables. PWD=$PWD"
printf '%s\n' "text with variables. PWD=$PWD"
printf 'text with variables. PWD=%s\n' "$PWD"
-> text with variables. PWD=/home/xxx

# more advanced
FLOAT="1.2346777892864" INTEGER="12345.123"
echo "text with variabeles. float=$FLOAT, integer=$INTEGER, PWD=$PWD"
->text with variables. float=1.2346777892864, integer=12345.123, PWD=/home/xxx
echo "float=$FLOAT, integer=$INTEGER, PWD=$PWD"
-> float=1.2346777892864, integer=12345.123, PWD=/home/xxx

printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "" "$INTEGER"
"$PWD"
->text with variables. float=1.23, integer=12345, PWD=/home/xxx
printf "text with variables. float=%.2f, integer=%d, PWD=%s\n" "$FLOAT"
"$INTEGER" "$PWD"
-> float=1.23, integer=12345, PWD=/home/xxx
```

### Do not use #!/usr/bin/env bash
Expand Down Expand Up @@ -323,6 +324,9 @@ curl -m 10 https://api.telegram.org/bot
wget -t 1 -T 10 https://api.telegram.org/bot
#Connecting to api.telegram.org (api.telegram.org)|46.38.243.234|:443...
failed: Connection timed out.

nc -w 2 api.telegram.org 443 || echo "your IP seems blocked by telegram"
#your IP seems blocked by telegram
```

Since Version 0.96 bashbot offers the option to recover from broken connections
Expand Down Expand Up @@ -355,4 +359,4 @@ wait
If you feel that there's something missing or if you found a bug, feel free to
submit a pull request!

#### $$VERSION$$ v1.1-0-ge835bbc
#### $$VERSION$$ v1.20-0-g2ab00a2
2 changes: 1 addition & 1 deletion addons/antiFlood.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# this addon counts how many files, e.g. stickers, are sent to
# a chat and takes actions if threshold is reached
#
#### $$VERSION$$ v1.0-0-g99217c4
#### $$VERSION$$ v1.20-0-g2ab00a2

# used events:
#
Expand Down
2 changes: 1 addition & 1 deletion addons/example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Addons can register to bashbot events at startup
# by providing their name and a callback per event
#
#### $$VERSION$$ v1.2-dev-13-g2a5d47d
#### $$VERSION$$ v1.20-0-g2ab00a2
#
# If an event occurs each registered event function is called.
#
Expand Down
10 changes: 7 additions & 3 deletions bashbot.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/sh
# description: Start or stop telegram-bash-bot
#
#### $$VERSION$$ v1.2-dev-13-g2a5d47d
# example service script to run bashbot in background as specified user
#
# tested on: ubuntu, opensuse, debian
#
#### $$VERSION$$ v1.20-0-g2ab00a2
# shellcheck disable=SC2009
# shellcheck disable=SC2181

Expand All @@ -23,9 +27,9 @@ runcmd="echo Dry run:" # not activated until you edit lines below
# Configuration Section

# edit the next line to fit the user you want to run bashbot, e.g. nobody:
runas="nobody"
runas="nobody"

# uncomment one of the following lines to fit your system
# uncomment one of the example lines to fit your system
# runcmd="su $runas -s /bin/bash -c " # runasuser with *su*
# runcmd="runuser $runas -s /bin/bash -c " # runasuser with *runuser*

Expand Down
Loading