Skip to content

Commit

Permalink
Merge pull request #161 from topkecleon/develop Version 1.20
Browse files Browse the repository at this point in the history
Version 1.2
  • Loading branch information
gnadelwartz committed Dec 25, 2020
2 parents 74e0aa3 + 239dd76 commit 74ab0c2
Show file tree
Hide file tree
Showing 69 changed files with 1,391 additions and 760 deletions.
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

0 comments on commit 74ab0c2

Please sign in to comment.