-
Notifications
You must be signed in to change notification settings - Fork 3
/
tgbot.sh
101 lines (87 loc) · 2.17 KB
/
tgbot.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
#Clear & Clean terminal before starting
clear
rm -f bot.log
# Source core utils
source .token.sh
source util.sh
# Source functions
source bot/all_replace.sh
source bot/button.sh
source bot/calc.sh
source bot/choice.sh
source bot/info.sh
source bot/iq.sh
source bot/log_dump.sh
source bot/magisk.sh
source bot/neofetch.sh
source bot/pfp.sh
source bot/purge.sh
source bot/replace.sh
source bot/reset_log.sh
source bot/round.sh
source bot/spam_protector.sh
source bot/start.sh
source bot/shuffle.sh
source bot/weath.sh
source bot/bot_util.sh
source bot/shell.sh
log -i tgbot "STARTING BOT"
# Defining constants
readonly sauraj_discussion_groupid=-1001470915975
readonly msg_spam_words=(
crypto
bitcoin
forex
"t.me/joinchat/"
drеаmswhales
invest
"t.me/+"
ᴛʀᴀᴅɪɴɢ
ɪɴᴠᴇsᴛ
trading
trade
usdt
btc
profit
invested
earn
investment
financeexchange
)
# Initialize update
update_init
## While loop
while true; do
# Refresh stuff
update
[ "$RET_MSG_TEXT" ] && log -v tgbot "Message received: $RET_MSG_TEXT" | tee -a log
[ "$RET_MSG_TEXT" ] && log -v tgbot " -> Chat title: $RET_CHAT_TITLE" | tee -a log &
[ "$RET_MSG_TEXT" ] && log -v tgbot " -> Chat id: $RET_CHAT_ID" | tee -a log &
RET_LOWERED_MSG_TEXT=$(tr '[:upper:]' '[:lower:]' <<<"$RET_MSG_TEXT")
case $RET_LOWERED_MSG_TEXT in
'/start'*) start | tee -a log ;;
'.all_replace'*) all_replace | tee -a log ;;
'.button'*) button & ;;
'.calc'*) calc | tee -a log ;;
'.choice'*) choice | tee -a log ;;
'.iq'*) iq | tee -a log ;;
'.info'*) info | tee -a log ;;
'.magisk'*) magisk | tee -a log ;;
'.neofetch'*) neo_fetch | tee -a log ;;
'.pfp'*) pfp | tee -a log ;;
'.replace'*) replace | tee -a log ;;
'.round'*) round_msg | tee -a log;;
'.weath'*) weath | tee -a log ;;
'.log'*) log_dump ;;
'.reset_log'*) reset_log ;;
'.shuffle'*) shuffle ;;
'.purge'*) purge ;;
'.restart'*) bot_util::restart ;;
'.update'*) bot_util::update ;;
'.shell'*) shell ;;
esac
# Always run this
spam_protector
unset RET_MSG_TEXT RET_REPLIED_MSG_ID
done