forked from MrMKN/Simple-Rename-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
30 lines (25 loc) · 768 Bytes
/
bot.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
from pyrogram import Client
from config import *
import os
class Bot(Client):
if not os.path.isdir(DOWNLOAD_LOCATION):
os.makedirs(DOWNLOAD_LOCATION)
def __init__(self):
super().__init__(
name="simple-renamer",
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN,
workers=100,
plugins={"root": "main"},
sleep_threshold=10,
)
async def start(self):
await super().start()
me = await self.get_me()
print(f"{me.first_name} | @{me.username} 𝚂𝚃𝙰𝚁𝚃𝙴𝙳...⚡️")
async def stop(self, *args):
await super().stop()
print("Bot Restarting........")
bot = Bot()
bot.run()