-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (24 loc) · 748 Bytes
/
main.py
File metadata and controls
28 lines (24 loc) · 748 Bytes
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
# (c) @HORRIDduo
from pyrogram import Client
from config import API_ID, API_HASH, BOT_TOKEN
from aiohttp import web
from CodeRunBot import web_server
class Bot(Client):
def __init__(self):
super().__init__(
name="CodeRunBot",
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN,
workers=200,
plugins={"root": "CodeRunBot"},
sleep_threshold=15,
)
async def start(self):
await super().start()
me = await self.get_me()
app = web.AppRunner(await web_server())
await app.setup()
await web.TCPSite(app, "0.0.0.0", 8080).start()
print(f"{me.first_name} Now Working 😘")
Bot().run()