-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathbot.py
More file actions
29 lines (25 loc) · 848 Bytes
/
Copy pathbot.py
File metadata and controls
29 lines (25 loc) · 848 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
import pyromod.listen
from pyrogram import Client
from config import API_HASH, APP_ID, LOGGER, TG_BOT_TOKEN, TG_BOT_WORKERS
class Bot(Client):
def __init__(self):
super().__init__(
"Bot",
api_hash=API_HASH,
api_id=APP_ID,
plugins={
"root": "plugins"
},
workers=TG_BOT_WORKERS,
bot_token=TG_BOT_TOKEN
)
self.LOGGER = LOGGER
async def start(self):
await super().start()
usr_bot_me = await self.get_me()
self.set_parse_mode("html")
self.LOGGER(__name__).info(f"Бот запущен..!\n\nКанал @ITHard")
self.username = usr_bot_me.username
async def stop(self, *args):
await super().stop()
self.LOGGER(__name__).info("Бот остановлен.")