-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathmain.py
More file actions
69 lines (59 loc) Β· 1.76 KB
/
main.py
File metadata and controls
69 lines (59 loc) Β· 1.76 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
import asyncio
import json
from bot import Bot, web_app
from pyrogram import compose
# Static default fallback message templates (can be overridden per setup entry if needed)
default_messages = {
'START': '<blockquote expandable>__Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit sed.\nVivamus luctus urna sed urna.\nCurabitur blandit tempus porttitor.\nNullam quis risus eget urna.__</blockquote>',
'FSUB': '',
'ABOUT': 'ABOUT MSG',
'REPLY': 'reply_text',
'START_PHOTO': '',
'FSUB_PHOTO': ''
}
async def main():
app = []
# Load setup.json
with open("setup.json", "r", encoding="utf-8") as f:
setups = json.load(f)
# Loop through each bot setup config
for config in setups:
session = config["session"]
workers = config["workers"]
db = config["db"]
fsubs = config["fsubs"]
token = config["token"]
admins = config["admins"]
messages = config.get("messages", default_messages)
auto_del = config["auto_del"]
db_uri = config["db_uri"]
db_name = config["db_name"]
api_id = int(config["api_id"])
api_hash = config["api_hash"]
protect = config["protect"]
disable_btn = config["disable_btn"]
app.append(
Bot(
session,
workers,
db,
fsubs,
token,
admins,
messages,
auto_del,
db_uri,
db_name,
api_id,
api_hash,
protect,
disable_btn
)
)
await compose(app)
async def runner():
await asyncio.gather(
main(),
web_app()
)
asyncio.run(runner())