Bashbot Version 1.0

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-08-15 09:29:13 +02:00
parent 99217c4e25
commit 25a33b3731
59 changed files with 71 additions and 70 deletions

View File

@ -269,6 +269,6 @@ It features background tasks and interactive chats, and can serve as an interfac
<p>@Gnadelwartz</p>
<h2>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>$$VERSION$$ 0.99-2-gacf9d84</h4>
<h4>$$VERSION$$ v1.0-0-g99217c4</h4>
</body>
</html>

View File

@ -261,4 +261,4 @@ bashbotBlockRecover() {
If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
#### $$VERSION$$ 0.99-2-gacf9d84
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -351,4 +351,4 @@ wait
If you feel that there's something missing or if you found a bug, feel free to
submit a pull request!
#### $$VERSION$$ 0.99-2-gacf9d84
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# used events:
#

View File

@ -4,7 +4,7 @@
# Addons can register to bashbot events at startup
# by providing their name and a callback per event
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
#
# If an event occurs each registered event function is called.
#

View File

@ -1,7 +1,7 @@
#!/bin/sh
# description: Start or stop telegram-bash-bot
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# shellcheck disable=SC2009
# shellcheck disable=SC2181

View File

@ -11,7 +11,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ 0.99-10-gb9c8dc0
#### $$VERSION$$ v1.0-0-g99217c4
#
# Exit Codes:
# - 0 success (hopefully)

View File

@ -15,7 +15,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ 0.99-5-gaec7345
#### $$VERSION$$ v1.0-0-g99217c4
#
# adjust your language setting here, e.g.when run from other user or cron.

View 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$$ 0.99-8-g6011444
#### $$VERSION$$ v1.0-0-g99217c4
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script

View File

@ -3,7 +3,7 @@
#
# works together with git pre-push.sh and ADD all changed files since last push
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-13-g6a6410e
#### $$VERSION$$ v1.0-0-g99217c4
############
# NOTE: you MUST run install-hooks.sh again when updating this file!

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
############
# NOTE: you MUST run install-hooks.sh again when updating this file!

View 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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script

View File

@ -2,7 +2,7 @@
# file: make-distribution.sh
# creates files and arcchives to dirtribute bashbot
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script

View File

@ -5,7 +5,7 @@
# If you your bot is finished you can use make-standalone.sh to create the
# the old all-in-one bashbot: bashbot.sh and commands.sh only!
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script

View File

@ -1,4 +1,4 @@
# list of additional files to check from shellcheck
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
bashbot.rc
mycommands.sh.clean

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# shellcheck disable=SC2016
#
# Easy Versioning in git:

View File

@ -131,5 +131,5 @@ The old format is supported for backward compatibility, but may fail for corner
#### [Next Create Bot](1_firstbot.md)
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -65,5 +65,5 @@ group. This step is up to you actually.
#### [Prev Installation](0_install.md)
#### [Next Getting started](2_usage.md)
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -283,5 +283,5 @@ send_action "${CHAT[ID]}" "action"
#### [Prev Create Bot](1_firstbot.md)
#### [Next Advanced Usage](3_advanced.md)
#### $$VERSION$$ 0.99-1-g3daf84d
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -288,5 +288,5 @@ Note: If you disable automatic retry, se above, you disable also connection prob
#### [Prev Getting started](2_usage.md)
#### [Next Expert Use](4_expert.md)
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -378,5 +378,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms.
#### [Prev Advanced Use](3_advanced.md)
#### [Next Best Practice](5_practice.md)
#### $$VERSION$$ 0.99-1-g3daf84d
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -158,5 +158,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$$ 0.99-1-g3daf84d
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -1049,5 +1049,5 @@ The name of your bot is available as bash variable "$ME", there is no need to ca
#### [Prev Best Practice](5_practice.md)
#### [Next Notes for Developers](7_develop.md)
#### $$VERSION$$ 0.99-17-g9d7f145
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -347,5 +347,5 @@ fi
#### [Prev Function Reference](6_reference.md)
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -56,6 +56,6 @@ convert existing bots.
**jsonDB-keybords** contains a stripped down real world example from my bot showing the usage of jsonDB to store and retrieve values
plus use of keyboards in private chats. It's an extended version of mycommands.sh.dist. Messages and help are in german.
#### $$VERSION$$ 0.99-13-g6a6410e
#### $$VERSION$$ v1.0-0-g99217c4

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -2,7 +2,7 @@
# file: run_filename
# background job to display content of all new files in WATCHDIR
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -2,7 +2,7 @@
# file: run_filename
# background job to display all new files in WATCHDIR
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -6,7 +6,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -2,7 +2,7 @@
# file. multibot.sh
# description: run multiple telegram bots from one installation
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
if [ "${2}" = "" ] || [ "${2}" = "-h" ]; then
echo "Usage: $0 botname command"

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
SHELL=/bin/sh

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -2,7 +2,7 @@
# files: mycommands.sh.dist
# copy to mycommands.sh and add all your commands and functions here ...
#
#### $$VERSION$$ 0.99-16-gd6de66d
#### $$VERSION$$ v1.0-0-g99217c4
#
# shellcheck disable=SC2154
# shellcheck disable=SC2034

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -1,7 +1,7 @@
# file: botacl
# a user not listed here, will return false from 'user_is_allowed'
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# Format:
# user:resource:chat

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
#
# shellcheck disable=SC2154
# shellcheck disable=SC2034

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
#
# will be automatically sourced from bashbot

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# will be automatically sourced from bashbot

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# will be automatically sourced from bashbot

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# will be automatically sourced from bashbot

View File

@ -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$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
#
# source from commands.sh to use jsonDB functions
#

View File

@ -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$$ 0.99-17-g9d7f145
#### $$VERSION$$ v1.0-0-g99217c4
# will be automatically sourced from bashbot

View File

@ -8,7 +8,7 @@
# #### if you start to develop your own bot, use the clean version of this file:
# #### mycommands.clean
#
#### $$VERSION$$ 0.99-15-g25578bf
#### $$VERSION$$ v1.0-0-g99217c4
#
# uncomment the following lines to overwrite info and help messages
@ -74,25 +74,26 @@ NOTBOTADMIN="Sorry, this command is allowed for bot owner only"
if [ "$1" = "startbot" ];then
###################
# this function is run once after startup when the first message is received
my_startup(){
# send message ito first user on startup
send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!"
}
# remind bot of start, now uses config store
# this section is processed on startup
# mark startup, triggers action on first message
setConfigKey "startupaction" "await"
else
# call my_startup when first message arrives
if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then
_exec_if_function my_startup
setConfigKey "startupaction" "done $(date)"
fi
#############################
# your own bashbot commands
# NOTE: command can have @botname attached, you must add * to case tests...
mycommands() {
#############
# action triggered on first message after startup
if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then
# send message to first user on startup
send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!"
# mark as done and when
setConfigKey "startupaction" "done $(date)"
fi
##############
# a service Message was received
# add your own stuff here

View File

@ -4,7 +4,7 @@
# files: mycommands.sh.clean
# copy to mycommands.sh and add all your commands and functions here ...
#
#### $$VERSION$$ 0.99-4-g15eb311
#### $$VERSION$$ v1.0-0-g99217c4
#
##########

View File

@ -6,7 +6,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ 0.99-5-gaec7345
#### $$VERSION$$ v1.0-0-g99217c4
######
# parameters

View File

@ -2,7 +2,7 @@
#
# ADD a new test skeleton to test dir, but does not activate test
#
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# common variables
export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
../dev/hooks/pre-commit.sh

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# file: b-example-test.sh
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.99-0-g2775000
#### $$VERSION$$ v1.0-0-g99217c4
# include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh