-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathloader.py
More file actions
53 lines (33 loc) · 1.07 KB
/
Copy pathloader.py
File metadata and controls
53 lines (33 loc) · 1.07 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
from pyrogram import Client
from info import *
from aiohttp import web
from route import web_server
class Bot(Client):
def __init__(self):
super().__init__(
name="tgbot",
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN,
workers=200,
plugins={"root": "plugins"},
sleep_threshold=10,
)
async def start(self):
await super().start()
me = await self.get_me()
self.id = me.id
self.name = me.first_name
self.mention = me.mention
self.username = me.username
self.force_channel = FORCE_SUB if FORCE_SUB else None
app = web.AppRunner(await web_server())
await app.setup()
bind_address = "0.0.0.0"
await web.TCPSite(app, bind_address, PORT).start()
print(f'{me.first_name} is Started...🍃')
async def stop(self, *args):
await super().stop()
print("Bot restarting.....")
app = Bot()
app.run()