2019-04-23 19:52:57 +00:00
|
|
|
#!/bin/bash
|
2021-01-20 18:50:19 +00:00
|
|
|
# file: modules/aliases.sh
|
2019-04-23 19:52:57 +00:00
|
|
|
# do not edit, this file will be overwritten on update
|
|
|
|
|
|
|
|
# This file is public domain in the USA and all free countries.
|
|
|
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
|
|
|
#
|
2021-06-03 12:21:40 +00:00
|
|
|
#### $$VERSION$$ v1.51-0-g6e66a28
|
2019-04-25 11:54:31 +00:00
|
|
|
#
|
2020-06-14 18:56:46 +00:00
|
|
|
# will be automatically sourced from bashbot
|
2019-04-25 11:54:31 +00:00
|
|
|
|
2020-05-14 17:47:37 +00:00
|
|
|
# source once magic, function named like file
|
|
|
|
eval "$(basename "${BASH_SOURCE[0]}")(){ :; }"
|
|
|
|
|
2019-05-20 17:16:00 +00:00
|
|
|
# easy handling of users:
|
|
|
|
_is_botadmin() {
|
|
|
|
user_is_botadmin "${USER[ID]}"
|
|
|
|
}
|
2019-04-23 19:52:57 +00:00
|
|
|
_is_admin() {
|
|
|
|
user_is_admin "${CHAT[ID]}" "${USER[ID]}"
|
|
|
|
}
|
2019-04-24 08:07:46 +00:00
|
|
|
_is_creator() {
|
|
|
|
user_is_creator "${CHAT[ID]}" "${USER[ID]}"
|
|
|
|
}
|
2019-04-23 19:52:57 +00:00
|
|
|
_is_allowed() {
|
2021-01-05 15:17:34 +00:00
|
|
|
user_is_allowed "${USER[ID]}" "$1" "${CHAT[ID]}"
|
2019-04-23 19:52:57 +00:00
|
|
|
}
|
2019-04-24 11:34:44 +00:00
|
|
|
_leave() {
|
|
|
|
leave_chat "${CHAT[ID]}"
|
|
|
|
}
|
|
|
|
_kick_user() {
|
2021-01-05 15:17:34 +00:00
|
|
|
kick_chat_member "${CHAT[ID]}" "$1"
|
2019-04-24 11:34:44 +00:00
|
|
|
}
|
|
|
|
_unban_user() {
|
2021-01-05 15:17:34 +00:00
|
|
|
unban_chat_member "${CHAT[ID]}" "$1"
|
2019-04-24 11:34:44 +00:00
|
|
|
}
|
|
|
|
# easy sending of messages of messages
|
2019-04-23 19:52:57 +00:00
|
|
|
_message() {
|
2021-01-05 15:17:34 +00:00
|
|
|
send_normal_message "${CHAT[ID]}" "$1"
|
2019-04-23 19:52:57 +00:00
|
|
|
}
|
|
|
|
_normal_message() {
|
2021-01-05 15:17:34 +00:00
|
|
|
send_normal_message "${CHAT[ID]}" "$1"
|
2019-04-23 19:52:57 +00:00
|
|
|
}
|
|
|
|
_html_message() {
|
2021-01-05 15:17:34 +00:00
|
|
|
send_html_message "${CHAT[ID]}" "$1"
|
2019-04-23 19:52:57 +00:00
|
|
|
}
|
|
|
|
_markdown_message() {
|
2021-01-05 15:17:34 +00:00
|
|
|
send_markdown_message "${CHAT[ID]}" "$1"
|
2019-04-25 11:54:31 +00:00
|
|
|
}
|
|
|
|
# easy handling of keyboards
|
|
|
|
_inline_button() {
|
2021-01-05 15:17:34 +00:00
|
|
|
send_inline_button "${CHAT[ID]}" "" "$1" "$2"
|
2019-04-25 11:54:31 +00:00
|
|
|
}
|
|
|
|
_inline_keyboard() {
|
2021-01-05 15:17:34 +00:00
|
|
|
send_inline_keyboard "${CHAT[ID]}" "" "$1"
|
2019-04-25 11:54:31 +00:00
|
|
|
}
|
|
|
|
_keyboard_numpad() {
|
2019-04-25 14:59:17 +00:00
|
|
|
send_keyboard "${CHAT[ID]}" "" '["1","2","3"],["4","5","6"],["7","8","9"],["-","0","."]' "yes"
|
2019-04-25 11:54:31 +00:00
|
|
|
}
|
|
|
|
_keyboard_yesno() {
|
2019-04-25 14:59:17 +00:00
|
|
|
send_keyboard "${CHAT[ID]}" "" '["yes","no"]'
|
2019-04-25 11:54:31 +00:00
|
|
|
}
|
|
|
|
_del_keyboard() {
|
2019-04-25 14:59:17 +00:00
|
|
|
remove_keyboard "${CHAT[ID]}" ""
|
2019-04-23 19:52:57 +00:00
|
|
|
}
|