-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathuser.py
More file actions
28 lines (23 loc) · 714 Bytes
/
Copy pathuser.py
File metadata and controls
28 lines (23 loc) · 714 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) @DarkzzAngel
from config import Config
from config import LOGGER
from pyrogram import Client, __version__
class User(Client):
def __init__(self):
super().__init__(
Config.SESSION,
api_hash=Config.API_HASH,
api_id=Config.API_ID,
workers=4
)
self.LOGGER = LOGGER
async def start(self):
await super().start()
usr_bot_me = await self.get_me()
print(f"Userbot Account {usr_bot_me.first_name} started")
return (self, usr_bot_me.id)
async def stop(self, *args):
await super().stop()
self.LOGGER(__name__).info("Bot stopped. Bye.")