-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33ee33a
commit da7c821
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from pyrogram import Client, filters | ||
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, Message | ||
from pyrogram.errors import ChatAdminRequired, UserNotParticipant, ChatWriteForbidden | ||
from Spotify_Music import app | ||
|
||
#-------------------------- | ||
|
||
MUST_JOIN = "ll_THE_BAD_BOT_ll" | ||
#------------------------ | ||
@app.on_message(filters.incoming & filters.private, group=-1) | ||
async def must_join_channel(app: Client, msg: Message): | ||
if not MUST_JOIN: | ||
return | ||
try: | ||
try: | ||
await app.get_chat_member(MUST_JOIN, msg.from_user.id) | ||
except UserNotParticipant: | ||
if MUST_JOIN.isalpha(): | ||
link = "https://t.me/" + MUST_JOIN | ||
else: | ||
chat_info = await app.get_chat(MUST_JOIN) | ||
link = chat_info.invite_link | ||
try: | ||
await msg.reply_photo( | ||
photo="https://telegra.ph/file/d44e57c7d8586edf6ee18.jpg", caption=f"๏ ᴀᴄᴄᴏʀᴅɪɴɢ ᴛᴏ ᴍʏ ᴅᴀᴛᴀʙᴀsᴇ ʏᴏᴜ'ᴠᴇ ɴᴏᴛ ᴊᴏɪɴᴇᴅ [๏sᴜᴘᴘᴏʀᴛ๏]({link}) ʏᴇᴛ, ɪғ ʏᴏᴜ ᴡᴀɴᴛ ᴛᴏ ᴜsᴇ ᴍᴇ ᴛʜᴇɴ ᴊᴏɪɴ [๏sᴜᴘᴘᴏʀᴛ๏]({link}) ᴀɴᴅ sᴛᴀʀᴛ ᴍᴇ ᴀɢᴀɪɴ ! ", | ||
reply_markup=InlineKeyboardMarkup( | ||
[ | ||
[ | ||
InlineKeyboardButton("๏Jᴏɪɴ๏", url=link), | ||
] | ||
] | ||
) | ||
) | ||
await msg.stop_propagation() | ||
except ChatWriteForbidden: | ||
pass | ||
except ChatAdminRequired: | ||
print(f"๏ᴘʀᴏᴍᴏᴛᴇ ᴍᴇ ᴀs ᴀɴ ᴀᴅᴍɪɴ ɪɴ ᴛʜᴇ ᴍᴜsᴛ_Jᴏɪɴ ᴄʜᴀᴛ ๏: {MUST_JOIN} !") |