mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-09-28 00:09:02 +00:00
Merge pull request #150 from dcoomber/develop
Updated references from `bas` to `bash` and other cosmetic changes to docs
This commit is contained in:
commit
9b3d689b9f
@ -633,8 +633,8 @@ process_client() {
|
|||||||
jssh_countKeyDB_async "${CHAT[ID]}" "${COUNTFILE}"
|
jssh_countKeyDB_async "${CHAT[ID]}" "${COUNTFILE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
declare -Ax BASBOT_EVENT_INLINE BASBOT_EVENT_MESSAGE BASHBOT_EVENT_CMD BASBOT_EVENT_REPLY BASBOT_EVENT_FORWARD BASHBOT_EVENT_SEND
|
declare -Ax BASHBOT_EVENT_INLINE BASHBOT_EVENT_MESSAGE BASHBOT_EVENT_CMD BASHBOT_EVENT_REPLY BASHBOT_EVENT_FORWARD BASHBOT_EVENT_SEND
|
||||||
declare -Ax BASBOT_EVENT_CONTACT BASBOT_EVENT_LOCATION BASBOT_EVENT_FILE BASHBOT_EVENT_TEXT BASHBOT_EVENT_TIMER BASHBOT_BLOCKED
|
declare -Ax BASHBOT_EVENT_CONTACT BASHBOT_EVENT_LOCATION BASHBOT_EVENT_FILE BASHBOT_EVENT_TEXT BASHBOT_EVENT_TIMER BASHBOT_BLOCKED
|
||||||
|
|
||||||
start_timer(){
|
start_timer(){
|
||||||
# send alarm every ~60 s
|
# send alarm every ~60 s
|
||||||
@ -1006,7 +1006,7 @@ bot_init() {
|
|||||||
fi
|
fi
|
||||||
#setup bashbot
|
#setup bashbot
|
||||||
[[ "${UID}" -eq "0" ]] && RUNUSER="nobody"
|
[[ "${UID}" -eq "0" ]] && RUNUSER="nobody"
|
||||||
echo -n "Enter User to run basbot [$RUNUSER]: "
|
echo -n "Enter User to run bashbot [$RUNUSER]: "
|
||||||
read -r TOUSER
|
read -r TOUSER
|
||||||
[ -z "$TOUSER" ] && TOUSER="$RUNUSER"
|
[ -z "$TOUSER" ] && TOUSER="$RUNUSER"
|
||||||
if ! id "$TOUSER" &>/dev/null; then
|
if ! id "$TOUSER" &>/dev/null; then
|
||||||
|
10
commands.sh
10
commands.sh
@ -9,7 +9,7 @@
|
|||||||
# |_____/ \___/ |_| |_|\___/ \___) |_______)____|_|\___)_|
|
# |_____/ \___/ |_| |_|\___/ \___) |_______)____|_|\___)_|
|
||||||
#
|
#
|
||||||
# this file *MUST* not be edited! place your config and commands in
|
# this file *MUST* not be edited! place your config and commands in
|
||||||
# the file "mycommnds.sh". a clean version is provided as "mycommands.clean"
|
# the file "mycommands.sh". a clean version is provided as "mycommands.sh.clean"
|
||||||
#
|
#
|
||||||
|
|
||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
@ -29,7 +29,7 @@ unset IFS
|
|||||||
|
|
||||||
#-----------------------------
|
#-----------------------------
|
||||||
# this file *MUST* not edited!
|
# this file *MUST* not edited!
|
||||||
# copy "mycommands.sh.dist" to "mycommnds.sh" and change the strings there
|
# copy "mycommands.sh.dist" to "mycommands.sh" and change the strings there
|
||||||
bashbot_info='This is bashbot, the Telegram bot written entirely in bash.
|
bashbot_info='This is bashbot, the Telegram bot written entirely in bash.
|
||||||
It features background tasks and interactive chats, and can serve as an interface for CLI programs.
|
It features background tasks and interactive chats, and can serve as an interface for CLI programs.
|
||||||
It currently can send, receive and forward messages, custom keyboards, photos, audio, voice, documents, locations and video files.
|
It currently can send, receive and forward messages, custom keyboards, photos, audio, voice, documents, locations and video files.
|
||||||
@ -37,7 +37,7 @@ It currently can send, receive and forward messages, custom keyboards, photos, a
|
|||||||
|
|
||||||
#-----------------------------
|
#-----------------------------
|
||||||
# this file *MUST* not edited!
|
# this file *MUST* not edited!
|
||||||
# copy "mycommands.sh.dist" to "mycommnds.sh" and change the strings there
|
# copy "mycommands.sh.dist" to "mycommands.sh" and change the strings there
|
||||||
bashbot_help='Place your own commands and messages in mycommands.sh
|
bashbot_help='Place your own commands and messages in mycommands.sh
|
||||||
|
|
||||||
*Available commands*:
|
*Available commands*:
|
||||||
@ -65,7 +65,7 @@ fi
|
|||||||
|
|
||||||
#----------------------------
|
#----------------------------
|
||||||
# this file *MUST* not edited!
|
# this file *MUST* not edited!
|
||||||
# copy "mycommands.sh.dist" to "mycommnds.sh" and change the values there
|
# copy "mycommands.sh.dist" to "mycommands.sh" and change the values there
|
||||||
# defaults to no inline and nonsense home dir
|
# defaults to no inline and nonsense home dir
|
||||||
export INLINE="0"
|
export INLINE="0"
|
||||||
export FILE_REGEX="${BASHBOT_ETC}/.*"
|
export FILE_REGEX="${BASHBOT_ETC}/.*"
|
||||||
@ -97,7 +97,7 @@ if [ -z "${1}" ] || [[ "${1}" == *"debug"* ]];then
|
|||||||
case "${MESSAGE}" in
|
case "${MESSAGE}" in
|
||||||
################################################
|
################################################
|
||||||
# this file *MUST* not edited!
|
# this file *MUST* not edited!
|
||||||
# copy "mycommands.sh.dist" to "mycommnds.sh" and change the values and add your commands there
|
# copy "mycommands.sh.dist" to "mycommands.sh" and change the values and add your commands there
|
||||||
#
|
#
|
||||||
# GLOBAL commands start here, edit messages only
|
# GLOBAL commands start here, edit messages only
|
||||||
'/info'*)
|
'/info'*)
|
||||||
|
@ -26,7 +26,7 @@ passed=0
|
|||||||
#echo PLAN ${#all_tests}
|
#echo PLAN ${#all_tests}
|
||||||
for test in $(find ./*-test.sh | sort -u) ;
|
for test in $(find ./*-test.sh | sort -u) ;
|
||||||
do
|
do
|
||||||
[ "${test}" = "test/all-tests.sh" ] && continue
|
[ "${test}" = "dev/all-tests.sh" ] && continue
|
||||||
[ ! -x "${test}" ] && continue
|
[ ! -x "${test}" ] && continue
|
||||||
tests=$((tests+1))
|
tests=$((tests+1))
|
||||||
echo "TEST: ${test}"
|
echo "TEST: ${test}"
|
||||||
@ -56,6 +56,6 @@ fi
|
|||||||
echo -e "${passed} / ${tests}\\n"
|
echo -e "${passed} / ${tests}\\n"
|
||||||
[ -d "${TESTENV}" ] && echo "Logfiles from run are in ${TESTENV}"
|
[ -d "${TESTENV}" ] && echo "Logfiles from run are in ${TESTENV}"
|
||||||
|
|
||||||
ls -ld /tmp/bashbot.test* 2>/dev/null && echo "Don not forget to deleted bashbot test files in /tmp!!"
|
ls -ld /tmp/bashbot.test* 2>/dev/null && echo "Do not forget to delete bashbot test files in /tmp!!"
|
||||||
|
|
||||||
exit ${exitcode}
|
exit ${exitcode}
|
||||||
|
@ -65,7 +65,7 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if which codespell &>/dev/null; then
|
if command -v codespell &>/dev/null; then
|
||||||
echo "Running codespell"
|
echo "Running codespell"
|
||||||
echo "............................"
|
echo "............................"
|
||||||
codespell -B 1 --skip="*.log,*.html,*.txt,.git*,jsonDB-keyboard" -L "ba"
|
codespell -B 1 --skip="*.log,*.html,*.txt,.git*,jsonDB-keyboard" -L "ba"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* /usr/local if you want to run as service
|
* /usr/local if you want to run as service
|
||||||
2. [Download latest release zip from github](https://github.com/topkecleon/telegram-bot-bash/releases) and extract all files.
|
2. [Download latest release zip from github](https://github.com/topkecleon/telegram-bot-bash/releases) and extract all files.
|
||||||
3. Change into the directory ```telegram-bot-bash```
|
3. Change into the directory ```telegram-bot-bash```
|
||||||
4. Acticate the bot example commands ``cp mycommands.sh.dist mycommands.sh```
|
4. Activate the bot example commands ``cp mycommands.sh.dist mycommands.sh```
|
||||||
5. Run ```./bashbot.sh init``` to setup the environment and enter your Bots token given by botfather.
|
5. Run ```./bashbot.sh init``` to setup the environment and enter your Bots token given by botfather.
|
||||||
|
|
||||||
Edit 'mycommands.sh to your needs.
|
Edit 'mycommands.sh to your needs.
|
||||||
@ -24,7 +24,7 @@ As an alternative to download the zip files, you can clone the github repository
|
|||||||
* /usr/local if you want to run as service
|
* /usr/local if you want to run as service
|
||||||
2. Run ```git clone https://github.com/topkecleon/telegram-bot-bash.git```
|
2. Run ```git clone https://github.com/topkecleon/telegram-bot-bash.git```
|
||||||
3. Change into the directory ```telegram-bot-bash```
|
3. Change into the directory ```telegram-bot-bash```
|
||||||
4. Run ``` test/ALL-tests.sh``` and if everything finish OK ...
|
4. Run ``` dev/all-tests.sh``` and if everything finish OK ...
|
||||||
5. Run ```sudo ./bashbot.sh init``` to setup the environment and enter your Bots token given by botfather.
|
5. Run ```sudo ./bashbot.sh init``` to setup the environment and enter your Bots token given by botfather.
|
||||||
|
|
||||||
### Update bashbot
|
### Update bashbot
|
||||||
|
@ -47,7 +47,7 @@ Have FUN!
|
|||||||
│ ├── antiFlood.sh # simple addon taking actions based on # files and text sent to chat
|
│ ├── antiFlood.sh # simple addon taking actions based on # files and text sent to chat
|
||||||
│ └── xxxxxage.sh
|
│ └── xxxxxage.sh
|
||||||
│
|
│
|
||||||
├── bashbot.rc # start/stop script if you run basbot as service
|
├── bashbot.rc # start/stop script if you run bashbot as service
|
||||||
│
|
│
|
||||||
├── examples # example scripts and configs for bashbot
|
├── examples # example scripts and configs for bashbot
|
||||||
│ ├── README.md # description of files and examples
|
│ ├── README.md # description of files and examples
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# use ${ME} for current bot name in messages
|
# use ${ME} for current bot name in messages
|
||||||
# Note: you must escape '_' in botname with two \ in markdown messages!
|
# Note: you must escape '_' in botname with two \ in markdown messages!
|
||||||
export bashbot_info='This is @'"${ME//_/\\\\_}"', the Telegram example bot written entirely in bash.
|
export bashbot_info='This is @'"${ME//_/\\\\_}"', the Telegram example bot written entirely in bash.
|
||||||
Edit commands and messages in mycommnds.sh!
|
Edit commands and messages in mycommands.sh!
|
||||||
'
|
'
|
||||||
# export bashbot_help='*Available commands*:
|
# export bashbot_help='*Available commands*:
|
||||||
#'
|
#'
|
||||||
@ -89,7 +89,7 @@ else
|
|||||||
# action triggered on first message after startup
|
# action triggered on first message after startup
|
||||||
if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then
|
if [[ "$(getConfigKey "startupaction")" != "done"* ]]; then
|
||||||
# send message to first user on startup
|
# send message to first user on startup
|
||||||
send_normal_message "${CHAT[ID]}" "Hi, you was the first one after startup!"
|
send_normal_message "${CHAT[ID]}" "Hi, you are the first user after startup!"
|
||||||
# mark as done and when
|
# mark as done and when
|
||||||
setConfigKey "startupaction" "done $(date)"
|
setConfigKey "startupaction" "done $(date)"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user