forked from J-Rios/TLG_JoinCaptchaBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
160 lines (121 loc) · 4.67 KB
/
constants.py
File metadata and controls
160 lines (121 loc) · 4.67 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# -*- coding: utf-8 -*-
'''
Script:
constants.py
Description:
Constants values for join_captcha_bot.py
Author:
Jose Rios Rubio
Creation date:
09/09/2018
Last modified date:
22/06/2020
Version:
1.10.4
'''
################################################################################
### Imported modules ###
from os import path
################################################################################
### Constants ###
# Actual constants.py full path directory name
SCRIPT_PATH = path.dirname(path.realpath(__file__))
# General Bots Parameters
CONST = {
# Bot Token (get it from @BotFather)
"TOKEN": "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
# Bot Owner (i.e. "@JoseTLG" or "123456789")
"BOT_OWNER": "XXXXXXXXX",
# Languages texts files directory path
"LANG_DIR": SCRIPT_PATH + "/language",
# Chats directory path
"CHATS_DIR": SCRIPT_PATH + "/data/chats",
# Directory where create/generate temporary captchas
"CAPTCHAS_DIR": SCRIPT_PATH + "/data/captchas",
# Global whitelist file path (to allow whitelist blind users in all groups)
"F_WHITE_LIST": SCRIPT_PATH + "/data/whitelist.txt",
# Chat configurations JSON files
"F_CONF": "configs.json",
# Initial chat title at Bot start
"INIT_TITLE": "Unknown Chat",
# Initial chat link at Bot start
"INIT_LINK": "Unknown",
# Initial language at Bot start
"INIT_LANG": "EN",
# Initial enable/disable status at Bot start
"INIT_ENABLE": True,
# Initial captcha solve time (in minutes)
"INIT_CAPTCHA_TIME_MIN": 5,
# Initial captcha difficult level
"INIT_CAPTCHA_DIFFICULTY_LEVEL": 2,
# Initial captcha characters mode (nums, hex or ascci)
"INIT_CAPTCHA_CHARS_MODE": "nums",
# Initial new users just allow to send text messages
"INIT_RESTRICT_NON_TEXT_MSG": False,
# Default time (in mins) to remove self-destruct sent messages from the Bot
"T_DEL_MSG": 5,
# Auto-remove custom welcome message timeout
"T_DEL_WELCOME_MSG": 5,
# Custom Welcome message max length
"MAX_WELCOME_MSG_LENGTH": 3968,
# Maximum number of users allowed in each chat ignore list
"IGNORE_LIST_MAX": 100,
# Command don't allow in private chat text (just english due in private chats we
# don't have language configuration
"CMD_NOT_ALLOW_PRIVATE": "Can't use this command in the current chat.",
# Command just allow for Bot owner
"CMD_JUST_ALLOW_OWNER": "This command just can be use by the Bot Owner",
# Whitelist usage
"WHITELIST_USAGE": "Command usage (user ID or Alias):\n" \
"/whitelist add @peter123\n" \
"/whitelist rm 123456789",
# IANA Top-Level-Domain List (https://data.iana.org/TLD/tlds-alpha-by-domain.txt)
"F_TLDS": "tlds-alpha-by-domain.txt",
# Regular expression to detect URLs in a string based in TLD domains
"REGEX_URLS": r"((?<=[^a-zA-Z0-9])*(?:https\:\/\/|[a-zA-Z0-9]{{1,}}\.{{1}}|\b)" \
r"(?:\w{{1,}}\.{{1}}){{1,5}}(?:{})\b/?(?!@))",
# List string of supported languages commands shows in invalid language set
"SUPPORTED_LANGS_CMDS": \
"\nEnglish / English\n/language en\n" \
"\nSpanish / Español\n/language es\n" \
"\nFrench / Francais\n/language fr\n" \
"\nGerman / Deutch\n/language de\n" \
"\nItalian / Italiano\n/language it\n" \
"\nRussian / Pусский\n/language ru\n" \
"\nIndonesian / Indonesia\n/language id\n" \
"\nCatalan / Català\n/language ca\n" \
"\nBasque / Euskal\n/language eu\n" \
"\nGalician / Galego\n/language gl\n" \
"\nPortuguese-Brazil / Português-Brasil\n/language pt_br\n" \
"\nPolish / Polskie\n/language pl\n" \
"\nTurkish / Türkçe\n/language tr\n" \
"\nChinese-Simplified / 中文\n/language zh_cn",
# Bot developer
"DEVELOPER": "@JoseTLG",
# Bot code repository
"REPOSITORY": "https://github.com/J-Rios/TLG_JoinCaptchaBot",
# Developer Paypal address
"DEV_PAYPAL": "https://www.paypal.me/josrios",
# Developer Bitcoin address
"DEV_BTC": "3N9wf3FunR6YNXonquBeWammaBZVzTXTyR",
# Bot version
"VERSION": "1.10.4 (22/06/2020)"
}
# Supported languages list
TEXT = {
"EN": None, # English
"DE": None, # German
"FR": None, # French
"ID": None, # Indonesian
"IT": None, # Italian
"ES": None, # Spanish
"CA": None, # Catalan
"GL": None, # Galician
"EU": None, # Basque
"RU": None, # Rusian
"PT_BR": None, # Portuguese (Brasil)
"PL": None, # Polish
#"FA": None, # Persian (The json file is broken or json parser library doesn't support it)
"TR": None, # Turkish
"ZH_CN": None # Chinese (Mainland)
}