-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
5_6188447617496646250.py
66 lines (59 loc) · 2.27 KB
/
5_6188447617496646250.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
57
58
59
60
61
62
63
64
65
66
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
import asyncio
import json
import math
import os
import time
# the secret configuration specific things
if bool(os.environ.get("WEBHOOK", False)):
from config import Config
else:
from config import Config
# the Strings used for this "thing"
from translation import Translation
import pyrogram
from pyrogram import filters
from pyrogram import Client as Shamil
logging.getLogger("pyrogram").setLevel(logging.WARNING)
from pyrogram.types import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram.errors import UserNotParticipant, UserBannedInChannel
@Shamil.on_message(pyrogram.filters.command(["start"]))
async def text(bot, update):
if update.from_user.id in Config.BANNED_USERS:
await update.reply_text("You are Banned")
return
update_channel = Config.UPDATE_CHANNEL
if update_channel:
try:
user = await bot.get_chat_member(update_channel, update.chat.id)
if user.status == "kicked":
await update.reply_text(" Sorry, You are **B A N N E D**")
return
except UserNotParticipant:
#await update.reply_text(f"Join @{update_channel} To Use Me")
await update.reply_text(
text="**Please Join My Update Channel Before Using Me..**",
reply_markup=InlineKeyboardMarkup([
[ InlineKeyboardButton(text="Join My Updates Channel", url=f"https://t.me/{update_channel}")]
])
)
return
else:
await update.reply_text(Translation.START_TEXT.format(update.from_user.first_name),
reply_markup=InlineKeyboardMarkup(
[
[
InlineKeyboardButton("⚙ Updates Channel", url=f"https://t.me/mwklinks"),
InlineKeyboardButton("🛠 Support Group", url=f"https://t.me/redbullfed")
],
[
InlineKeyboardButton("👨🔬 Developer", url=f"https://t.me/shamilnelli")
]
]
),
reply_to_message_id=update.message_id
)
# return