-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbot.py
More file actions
38 lines (31 loc) · 979 Bytes
/
bot.py
File metadata and controls
38 lines (31 loc) · 979 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
29
30
31
32
33
34
35
36
37
38
#SUNRISES24BOTS
#TG:@SUNRISES_24
from pyrogram import Client
from aiohttp import web
from main.web_support import web_server
from config import *
import os
class Bot(Client):
def __init__(self):
super().__init__(
name="PixelPulseBot",
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN,
workers=100,
plugins={"root": "main"},
sleep_threshold=10,
)
async def start(self):
await super().start()
me = await self.get_me()
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} | @{me.username} 𝚂𝚃𝙰𝚁𝚃𝙴𝙳...⚡️")
async def stop(self, *args):
await super().stop()
print("Bot Restarting........")
bot = Bot()
bot.run()