-
Notifications
You must be signed in to change notification settings - Fork 664
/
user.py
executable file
·30 lines (26 loc) · 916 Bytes
/
user.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
#----------------------------------- https://github.com/m4mallu/clonebot --------------------------------------------#
from pyrogram import Client
from pyrogram.enums import ParseMode
from config import Config
from config import LOGGER
class User(Client):
def __init__(self):
super().__init__(
name="user_session",
session_string=Config.TG_USER_SESSION,
api_hash=Config.API_HASH,
api_id=Config.APP_ID,
workers=4
)
self.LOGGER = LOGGER
async def start(self):
await super().start()
usr_bot_me = await self.get_me()
self.set_parse_mode(ParseMode.HTML)
self.LOGGER(__name__).info(
f"@{usr_bot_me.username} started!"
)
return self, usr_bot_me.id
async def stop(self, *args):
await super().stop()
self.LOGGER(__name__).info("Bot stopped. Bye.")