-
Notifications
You must be signed in to change notification settings - Fork 65
/
loader.py
49 lines (29 loc) · 926 Bytes
/
loader.py
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
from pyrogram import Client
from variables import *
from aiohttp import web
from route import web_server
class App(Client):
def __init__(self):
super().__init__(
"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
print(f'{me.first_name} is Started...🍃')
async def stop(self, *args):
await super().stop()
print("Bot restarting.....")
bot = App()
bot.run()