forked from vi2k6/Maintain-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
56 lines (46 loc) · 1.47 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
48
49
50
51
52
53
54
55
56
"""
Maintain, Telegram Maintain Bot
Copyright (C) 2021 Vivek-TP <https://t.me/Vivek_Kerala>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
"""
import os
import logging
from pyrogram import Client, filters
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
Bot = Client(
"Maintain-Bot",
bot_token=os.environ["BOT_TOKEN"],
api_id=int(os.environ["API_ID"]),
api_hash=os.environ["API_HASH"],
)
updatesc = os.environ["UPDATES_CHANNEL"]
supportc = os.environ["SUPPORT_CHAT"]
btname = os.environ["BOT_NAME"]
BOT_TEXT = """
Hai {} , This Bot Is Under Maintenance.
You Can't Use This Bot Right Now.You Will Get a Message On This Bot's Channel If This Bot Is Ready To Work.
"""
BOT_BUTTONS = InlineKeyboardMarkup(
[
[
InlineKeyboardButton(text="Channel", url=f"https://telegram.me/{updatesc}"),
InlineKeyboardButton(text="Support", url=f"https://telegram.me/{supportc}"),
]
]
)
@Bot.on_message(filters.private)
async def start(bot, update):
text = BOT_TEXT.format(update.from_user.mention)
reply_markup = BOT_BUTTONS
await update.reply_text(
text=text, disable_web_page_preview=True, reply_markup=reply_markup
)
print(
"""
Bot Contributed To {btname} And Started Started!!!
"""
)
Bot.run()