-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
115 lines (100 loc) · 4.47 KB
/
Copy pathconfig.py
File metadata and controls
115 lines (100 loc) · 4.47 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
# ╔══════════════════════════════════════╗
# ║ config.py — AsBhai Drop Bot ║
# ║ Configuration & Environment Variables║
# ╚══════════════════════════════════════╝
import os, logging
import pytz
from datetime import datetime
from dotenv import load_dotenv
load_dotenv()
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
# ═══════════════════════════════════════
# CONFIG — All from .env
# ═══════════════════════════════════════
API_ID = int(os.getenv("API_ID", "0"))
API_HASH = os.getenv("API_HASH", "")
BOT_TOKEN = os.getenv("BOT_TOKEN", "")
STRING_SESSION = os.getenv("STRING_SESSION", "")
MONGO_URI = os.getenv("MONGO_URI", "")
OWNER_ID = int(os.getenv("OWNER_ID", "7315805581"))
FILE_CHANNEL = int(os.getenv("FILE_CHANNEL", "-1002463804038"))
LOG_CHANNEL = int(os.getenv("LOG_CHANNEL", "-1002352329534"))
MAIN_CHANNEL = os.getenv("MAIN_CHANNEL", "@asbhai_bsr")
FORCE_SUB_CHANNEL = os.getenv("FORCE_SUB_CHANNEL", "@asbhai_bsr")
FORCE_SUB_ID = int(os.getenv("FORCE_SUB_ID", "-1002352329534"))
SHORTLINK_API = os.getenv("SHORTLINK_API", "e59d9a7076acc80820345129b5634aec2f6c54c6")
SHORTLINK_URL = os.getenv("SHORTLINK_URL", "arolinks.com")
SUPPORT_LINK = os.getenv("SUPPORT_LINK", "https://www.astoolswala.online/2026/05/tg-support.html?m=1")
HOW_TO_VERIFY = os.getenv("HOW_TO_VERIFY", "https://t.me/allinoneas_bot?start=BQADAQADKAgAAuB1cES49xXpxbUkjBYE")
KOYEB_URL = os.getenv("KOYEB_URL", "").rstrip("/")
ADMINS = [OWNER_ID]
IST = pytz.timezone("Asia/Kolkata")
UPI_ID = os.getenv("UPI_ID", "arsadsaifi8272@ibl")
PORT = int(os.getenv("PORT", "8080"))
# Link protection defaults
LINK_WARN_LIMIT = int(os.getenv("LINK_WARN_LIMIT", "3"))
# ── Blogger Verification System ──────────────────────────
# ── TMDb API (Movie Info + Poster) ───────────────────────
TMDB_API_KEY = os.getenv("TMDB_API_KEY", "") # .env mein set karo
TMDB_BASE = "https://api.themoviedb.org/3"
TMDB_IMG = "https://image.tmdb.org/t/p/w300" # Poster base URL
# ── Ad System ─────────────────────────────────────────────
AD_SYSTEM_ENABLED = os.getenv("AD_SYSTEM_ENABLED", "true").lower() == "true" # True = shortlink off, ad page use karo
BLOGGER_POST_URLS = [u.strip() for u in os.getenv("BLOGGER_POST_URLS", "").split(",") if u.strip()]
GOOGLE_SHEET_CSV_URL = os.getenv(
"GOOGLE_SHEET_CSV_URL",
"https://docs.google.com/spreadsheets/d/1j0QcRjoq20yP-BgOpLW562Kshtr-BLMwVTAgviBsjDY/pub?gid=0&single=true&output=csv"
)
# In-memory caches
_shortlink_cache = {}
_search_locks = {}
_search_cooldown = {}
_user_warnings = {} # {(chat_id, user_id): count}
def now():
from datetime import datetime
import pytz
return datetime.now(pytz.utc)
def now_ist():
return datetime.now(IST)
def make_aware(dt):
import pytz
if dt is None: return None
if dt.tzinfo is None: return pytz.utc.localize(dt)
return dt
DEFAULT_SETTINGS = {
"auto_delete": True,
"auto_delete_time": 300,
"force_sub": True,
"shortlink_enabled": True,
"daily_limit": 10,
"premium_results": 10,
"free_results": 5,
"welcome_msg": "👋 Welcome {name}! Koi bhi file ka naam type karo 🗂",
"maintenance": False,
"request_mode": False,
"fsub_channels": [
{"id": -1002283182645, "title": "AsBhai Channel", "username": ""},
{"id": -1002892671107, "title": "Latest Movies", "username": ""}
],
"fsub_groups": [],
"link_protection": True,
"link_warn_limit": 3,
"link_action": "warn",
"tmdb_enabled": True,
}
GROUP_DEFAULTS = {
"free_results": 5,
"premium_results": 10,
"force_sub": True,
"shortlink_enabled": True,
"auto_delete": True,
"auto_delete_time": 300,
"request_mode": False,
"link_protection": True,
"link_warn_limit": 3,
"link_action": "warn", # warn / mute / ban
}