-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (42 loc) · 1.44 KB
/
main.py
File metadata and controls
54 lines (42 loc) · 1.44 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
from pyrogram import (
Client,
__version__
)
from pyrogram.raw.all import layer
from info import Config
import logging
from datetime import datetime
import logging.config, os
from pytz import timezone
from aiohttp import web
from plugins import web_server
import pyromod
logging.config.fileConfig('logging.conf')
logging.getLogger().setLevel(logging.INFO)
logging.getLogger("pyrogram").setLevel(logging.ERROR)
class Bot (Client):
def __init__(self):
super().__init__(
name="ReportBot",
in_memory=True,
api_id=Config.API_ID,
api_hash=Config.API_HASH,
bot_token=Config.BOT_TOKEN,
plugins={'root': 'plugins'}
)
async def start(self):
await super().start()
me = await self.get_me()
self.mention = me.mention
self.username = me.username
app = web.AppRunner(await web_server())
await app.setup()
bind_address = "0.0.0.0"
await web.TCPSite(app, bind_address, Config.PORT).start()
logging.info(f"✅ {me.first_name} with for Pyrogram v{__version__} (Layer {layer}) started on {me.username}. ✅")
await self.send_message(Config.OWNER, f"**__{me.first_name} 𝖨𝖲 𝖲𝖳𝖠𝖱𝖳𝖤𝖣.....✨️__**")
async def stop(self, *args):
await super().stop()
logging.info("𝖸𝖮𝖴𝖱 𝖡𝖮𝖳 𝖲𝖳𝖮𝖯𝖤𝖣 ⛔")
bot = Bot()
bot.run()