forked from m4mallu/tube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
executable file
·48 lines (38 loc) · 1.14 KB
/
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
38
39
40
41
42
43
44
45
46
47
""" !/usr/bin/env python3
-*- coding: utf-8 -*-
Name : inline-tube-mate [ Telegram ]
Repo : https://github.com/m4mallu/inine-tube-mate
Author : Renjith Mangal [ https://t.me/space4renjith ]
Credits : https://github.com/SpEcHiDe/AnyDLBot """
import os
from pyrogram import Client
if bool(os.environ.get("ENV", False)):
from sample_config import Config
from sample_config import LOGGER
else:
from config import Config
from config import LOGGER
class Bot(Client):
def __init__(self):
super().__init__(
"bot",
bot_token=Config.TG_BOT_TOKEN,
api_id=Config.APP_ID,
api_hash=Config.API_HASH,
plugins={
"root": "plugins"
},
)
self.LOGGER = LOGGER
async def start(self):
await super().start()
me = await self.get_me()
self.set_parse_mode("html")
self.LOGGER(__name__).info(
f"@{me.username} started! "
)
async def stop(self, *args):
await super().stop()
self.LOGGER(__name__).info("Bot stopped. Bye.")
app = Bot()
app.run()