forked from 0AIB/Auto-Forward-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
37 lines (30 loc) · 952 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
31
32
33
34
35
36
37
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(lineno)d - %(module)s - %(levelname)s - %(message)s'
)
logging.getLogger().setLevel(logging.INFO)
logging.getLogger("pyrogram").setLevel(logging.WARNING)
import uvloop
uvloop.install()
from config import Config
from pyrogram import Client
class channelforward(Client, Config):
def __init__(self):
super().__init__(
name="CHANNELFORWARD",
bot_token=self.BOT_TOKEN,
api_id=self.API_ID,
api_hash=self.API_HASH,
workers=20,
plugins={'root': 'Plugins'}
)
async def start(self):
await super().start()
me = await self.get_me()
print(f"New session started for {me.first_name}({me.username})")
async def stop(self):
await super().stop()
print("Session stopped. Bye!!")
if __name__ == "__main__" :
channelforward().run()