-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.py
36 lines (23 loc) · 909 Bytes
/
init.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
31
32
33
34
35
36
from collections import defaultdict
import time
from pyrogram import Client
from db.database import Database
class bughunter0(Client):
def __init__(self):
super().__init__(
session_name=Config.SESSION_NAME,
bot_token = Config.BOT_TOKEN,
api_id = Config.API_ID,
api_hash = Config.API_HASH,
)
self.db = Database(Config.DATABASE_URL, Config.SESSION_NAME)
self.CURRENT_PROCESSES = defaultdict(lambda : 0)
self.CHAT_FLOOD = defaultdict(lambda : int(time.time()) - Config.SLOW_SPEED_DELAY-1)
self.broadcast_ids = {}
async def start(self):
await super().start()
me = await self.get_me()
print(f"\n\nNew session started for {me.first_name}({me.username})")
async def stop(self):
await super().stop()
print('Session stopped. Bye!!')