-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbot.py
54 lines (44 loc) · 1.39 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
"""
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.text)
def handler(client, message):
reply = BOT_TEXT
markup = InlineKeyboardMarkup([[BOT_BUTTONS]])
message.reply_text(reply, reply_markup=markup)
print(
"""
Bot Contributed To {btname} And Started Started!!!
"""
)
Bot.run()