Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
subinps committed Nov 1, 2021
1 parent 82e8eff commit 7e0e0e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@
},
"CHANNELS": {
"description": "Username or ID of channel or group. Separate multiple IDs by space.",
"value": ""
"required": false
},
"ADMINS": {
"description": "Username or ID of Admin. Separate multiple Admins by space.",
"value": ""
"required": true
},
"PICS": {
"description": "Add some telegraph link of pictures .",
"value": ""
"required": false
},
"LOG_CHANNEL": {
"description": "Bot Logs,Give a channel id with -100xxxxxxx",
"value": ""
"required": true
},
"SUPPORT_CHAT": {
"description": "Username of a Support Group / ADMIN. ( Should be username without @ and not ID)",
"value": ""
"required": false
},
"AUTH_USERS": {
"description": "Username or ID of users to give access of inline search. Separate multiple users by space.\nLeave it empty if you don't want to restrict bot usage.",
Expand All @@ -71,7 +71,7 @@
},
"DATABASE_NAME": {
"description": "Name of the database in mongoDB. For more help watch this video - https://youtu.be/dsuTn4qV2GA",
"required": true
"required": false
},
"COLLECTION_NAME": {
"description": "Name of the collections. Defaults to Telegram_files. If you are using the same database, then use different collection name for each bot",
Expand Down
14 changes: 7 additions & 7 deletions info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from os import environ
from ast import literal_eval as eval

id_pattern = re.compile(r'^.\d+$')


Expand All @@ -17,23 +17,23 @@

# Admins, Channels & Users
ADMINS = [int(admin) if id_pattern.search(admin) else admin for admin in environ.get('ADMINS', '').split()]
CHANNELS = [int(ch) if id_pattern.search(ch) else ch for ch in environ.get('CHANNELS', "").split()]
CHANNELS = [int(ch) if id_pattern.search(ch) else ch for ch in environ.get('CHANNELS', 0).split()]
auth_users = [int(user) if id_pattern.search(user) else user for user in environ.get('AUTH_USERS', '').split()]
AUTH_USERS = (auth_users + ADMINS) if auth_users else []
auth_channel = environ.get('AUTH_CHANNEL')
AUTH_CHANNEL = int(auth_channel) if auth_channel and id_pattern.search(auth_channel) else auth_channel
AUTH_GROUPS = [int(admin) for admin in environ.get("AUTH_GROUPS", "").split()]
auth_grp = environ.get('AUTH_GROUP')
AUTH_CHANNEL = int(auth_channel) if auth_channel and id_pattern.search(auth_channel) else None
AUTH_GROUPS = [int(ch) for ch in auth_grp.split()] if auth_grp else None

# MongoDB information
DATABASE_URI = environ.get('DATABASE_URI', "")
DATABASE_NAME = environ.get('DATABASE_NAME', "Rajappan")
COLLECTION_NAME = environ.get('COLLECTION_NAME', 'Telegram_files')

# Others
LOG_CHANNEL = int(environ.get('LOG_CHANNEL', ''))
LOG_CHANNEL = int(environ.get('LOG_CHANNEL', 0))
SUPPORT_CHAT = environ.get('SUPPORT_CHAT', 'TeamEvamaria')
P_TTTI_SHOW_OFF = eval((environ.get('P_TTTI_SHOW_OFF', "False")))
P_TTTI_SHOW_OFF = bool((environ.get('P_TTTI_SHOW_OFF', False)))
IMDB = bool((environ.get('IMDB', True)))
SINGLE_BUTTON = bool((environ.get('SINGLE_BUTTON', False)))
CUSTOM_FILE_CAPTION = environ.get("CUSTOM_FILE_CAPTION", None)
LONG_IMDB_DESCRIPTION = bool(environ.get("LONG_IMDB_DESCRIPTION", True))

0 comments on commit 7e0e0e8

Please sign in to comment.