Skip to content

Commit

Permalink
👨‍💻Update Channel
Browse files Browse the repository at this point in the history
  • Loading branch information
MRK-YT authored Jun 4, 2021
1 parent 68989d8 commit cb20499
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions bot/plugins/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,30 @@
from pyrogram.errors import UserNotParticipant
from bot import Translation # pylint: disable=import-error
from bot.database import Database # pylint: disable=import-error

from bot import UPDATE_CHANNEL
db = Database()


@Client.on_message(filters.command(["start"]) & filters.private, group=1)
async def start(bot, update):
update_channel = UPDATE_CHANNEL
if update_channel:
try:
user = await bot.get_chat_member(update_channel, update.chat.id)
if user.status == "kicked out":
await update.reply_text("😔 Sorry Dude, You are **🅱︎🅰︎🅽︎🅽︎🅴︎🅳︎ 🤣🤣🤣**")
return
except UserNotParticipant:
#await update.reply_text(f"Join @{update_channel} To Use Me")
await update.reply_text(
text="<b>🔊Join My Updates Channel to use ME</b>",
reply_markup=InlineKeyboardMarkup([
[ InlineKeyboardButton(text=" 💢 Join My Updates Channel 💢 ", url=f"https://t.me/{UPDATE_CHANNEL}")]
])
)
return
except Exception:
await update.reply_text("<b>This bot should be the admin on your update channel</b>\n\n<b>🗣️ any Doubt @Mo_Tech_Geoup</b>")
return
try:
file_uid = update.command[1]
except IndexError:
Expand Down

0 comments on commit cb20499

Please sign in to comment.