コード例 #1
0
ファイル: play.py プロジェクト: gagaoqphs/devilsmusic
async def deezer(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = await message_.reply_text(f"Searching 🔍🔎🔍🔎 for `{queryy}` on deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Found Literally Nothing, You Should Work On Your English!")
        is_playing = False
        return
    file_path = await convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover_square(requested_by, title, artist, duration,
                                thumbnail)
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        await res.edit("adding in queue")
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("▶️ Playing...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="final.png",
        caption=f"Playing [{title}]({url}) Via Deezer.")
    os.remove("final.png")
コード例 #2
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("🔄 Processing...")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("▶️ Playing...")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/file/fe07b15733ed56f103cb4.jpg.",
            caption=f"Playing Your song Via Devil music bot..",
            reply_markup=InlineKeyboardMarkup(
                [[InlineKeyboardButton("Skip", callback_data="skip")]]),
            parse_mode="markdown",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
コード例 #3
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ PROCESSING")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text(
                " GIVE ME A YT LINK TO PLAY [☺️](https://telegra.ph/file/9ae661b212ecce3ecf1a1.jpg)"
            )
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"qued at {position}.")
    else:
        await res.edit_text("⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ playing on voice chat")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/file/9ae661b212ecce3ecf1a1.jpg",
            caption=f"PLAYING YOUR SONGS ON VOICE CHAT VIA ⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
コード例 #4
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("AVENGERS MUSIC BOT=🔄 Processing...")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"AVENGERS MUSIC BOT=#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("AVENGERS MUSIC BOT=▶️ Playing...")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/file/1fe9a783253e7aefc73ce.jpg",
            caption=
            f"Playing Your song Via  [AVENGERS MUSIC BOT](https://t.me/avengers_help).",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
コード例 #5
0
ファイル: play.py プロジェクト: Sur-vivor/VCPlayerBot
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("Wyline=🔄 Işleme Alındı...")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Daha uzun videolar {DURATION_LIMIT} minute(s) izin verilmezse, sağlanan video {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ Bana çalacak bir şey vermedin..")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"〰️Wyline〰️=#️⃣ Konumda sıraya alındı {position}."
                            )
    else:
        await res.edit_text("Wyline=▶️ Çalınıyor...")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="https://telegra.ph/Wyline-04-05",
            caption=f"Çalınıyor [Wyline-İnline](https://t.me/WylineVoiceHelp).",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
コード例 #6
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice) if message_.reply_to_message else None
    chat_id=message_.chat.id
    res = await message_.reply_text("✯𝗗𝗘𝗡𝗩𝗜𝗟✯=🔄 Processing... Song")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await message_.reply_to_message.download(file_name))
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset+length]

        file_path =await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"✯𝗗𝗘𝗡𝗩𝗜𝗟✯=#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("✯𝗗𝗘𝗡𝗩𝗜𝗟✯=▶️ Playing... Song")
        res.delete
        m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="Others/thumbnail2.png",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("Support⚡️", url="https://t.me/MusicBotEnjoy_group")]]
        ),
        caption=f"Playing Your song Via  [✯𝗗𝗘𝗡𝗩𝗜𝗟✯](https://t.me/MusicBotEnjoy_group).",
         ) 
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
コード例 #7
0
ファイル: play.py プロジェクト: SmokerCat/devilsmusic-2.0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice) if message_.reply_to_message else None
    chat_id=message_.chat.id
    res = await message_.reply_text("🔄 Please Wait...")

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file = await convert(await message_.reply_to_message.download(file_name))
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ I don't know what you want to play")
            return

        url = text[offset:offset+length]

        file =await convert(download(url))

    if message_.chat.id in tgcalls.GroupsOn:
        position = sira.add(message_.chat.id, file)
        await res.edit_text(f"#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("▶️Now Playing...")
        res.delete
        m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="https://telegra.ph/file/5af2e8a554ace2ca898b0.jpg",
        caption=f"Playing Your song Via RADIO CAT.",
         ) 
        tgcalls.setsong(message_.chat.id, file)
コード例 #8
0
ファイル: play.py プロジェクト: khayal-0508/Khan_MusicBot
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice) if message_.reply_to_message else None
    chat_id=message_.chat.id
    res = await message_.reply_text("𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁=🔄 Əməliyyt aparılır...")
    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await message_.reply_to_message.download(file_name))
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❗Sən mənə oxutmaq üçün heç nə vermədin.")
            return

        url = text[offset:offset+length]

        file_path =await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁=#️⃣ Hazırlanır... {position}.")
    else:
        await res.edit_text("𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁=▶️ Oxuyur...")
        res.delete
        m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="https://t.me/c/1454783631/59992",
        caption=f"Mahnınızı 𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁 vasitəsilə çalınır...  [𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁](https://t.me/KhanVlog).",
         ) 
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
コード例 #9
0
ファイル: play.py プロジェクト: iamchildofcosmos/bookizzbot
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice) if message_.reply_to_message else None
    chat_id=message_.chat.id
    res = await message_.reply_text("🔄 Processing...")

    if audio:
        if round(audio.duration / 180) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 180} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await message_.reply_to_message.download(file_name))
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset+length]

        file_path =await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("▶️ Playing...")
        
         
        
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
コード例 #10
0
async def jiosaavn(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(
        f"Beta ruko jara sabar karo, dhund rahe hain `{query}` jio saavn pe")
    try:
        async with aiohttp.ClientSession() as session:
            async with session.get(
                    f"https://jiosaavnapi.bhadoo.uk/result/?query={query}"
            ) as resp:
                r = json.loads(await resp.text())
        sname = r[0]["song"]
        slink = r[0]["media_url"]
        ssingers = r[0]["singers"]
        sthumb = r[0]["image"]
        sduration = int(r[0]["duration"])
    except Exception as e:
        await res.edit(
            "7vi fail ho ka bacha? Likhna sikho phir thik se naam likhana gaane ka....Found Literally Nothing!"
        )
        print(str(e))
        is_playing = False
        return
    file_path = await convert(wget.download(slink))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"Koi dhakka mukki nahi karega, apka number hai {position}.")
    else:
        await res.edit_text("Ok sur, apka ganna baja rahe hain aab")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Generating Thumbnail.")
    await generate_cover_square(requested_by, sname, ssingers, sduration,
                                sthumb)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=
        f"Playing {sname} Via [🚩༺★Yogi Thanos Baba★༻🚩 Bot Network](https://t.me/ThanosAssistant_Bot)",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("Support⚡️",
                                 url="https://t.me/ThanosAssistant_Bot")
        ]]),
    )
    os.remove("final.png")
コード例 #11
0
async def jiosaavn(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"Searching.... `{query}` on jio saavn")
    try:
        async with aiohttp.ClientSession() as session:
            async with session.get(
                    f"https://jiosaavnapi.bhadoo.uk/result/?query={query}"
            ) as resp:
                r = json.loads(await resp.text())
        sname = r[0]["song"]
        slink = r[0]["media_url"]
        ssingers = r[0]["singers"]
        sthumb = r[0]["image"]
        sduration = int(r[0]["duration"])
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English.")
        print(str(e))
        is_playing = False
        return
    file_path = await convert(wget.download(slink))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"✯𝗔𝘂𝗿𝗮𝗫✯=#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("✯𝗔𝘂𝗿𝗮𝗫✯=▶️ Playing.... Song")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Generating Thumbnail.")
    await generate_cover_square(requested_by, sname, ssingers, sduration,
                                sthumb)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=
        f"Playing {sname} Via [Jiosaavn](https://t.me/MusicBotEnjoy_group)",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("Support⚡️",
                                 url="https://t.me/MusicBotEnjoy_group")
        ]]),
    )
    os.remove("final.png")
コード例 #12
0
async def jiosaavn(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(
        f"Searching 🔍🔎🔍🔎 for `{query}` on jio saavn")
    try:
        async with aiohttp.ClientSession() as session:
            async with session.get(
                    f"https://jiosaavnapi.bhadoo.uk/result/?query={query}"
            ) as resp:
                r = json.loads(await resp.text())
        sname = r[0]["song"]
        slink = r[0]["media_url"]
        ssingers = r[0]["singers"]
        sthumb = r[0]["image"]
        sduration = int(r[0]["duration"])
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English.")
        print(str(e))
        is_playing = False
        return
    file_path = await convert(wget.download(slink))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("▶️ Playing...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
    await res.edit("Processing Thumbnail.")
    await generate_cover_square(requested_by, sname, ssingers, sduration,
                                sthumb)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="final.png",
        caption=f"Playing [{title}]({url}) Via Deezer.",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("Skip", callback_data="skip")]]),
        parse_mode="markdown",
    )
    os.remove("final.png")
コード例 #13
0
async def deezer(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = await message_.reply_text(
        f"Beta ruko jara sabar karo, dhund rahe hain `{queryy}` deezer pe")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "7vi fail ho ka bacha? Likhna sikho phir thik se naam likhana gaane ka....Found Literally Nothing!"
        )
        is_playing = False
        return
    file_path = await convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover_square(requested_by, title, artist, duration,
                                thumbnail)
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        await res.edit("adding in queue")
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"Koi dhakka mukki nahi karega, apka number hai{position}.")
    else:
        await res.edit_text("Ok sur, apka ganna baja rahe hain aab")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="final.png",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("Support⚡️",
                                 url="https://t.me/ThanosAssistant_Bot")
        ]]),
        caption=
        f"Playing [{title}]({url}) Via [🚩༺★Yogi Thanos Baba★༻🚩 Bot Network](https://t.me/ThanosAssistant_Bot)."
    )
    os.remove("final.png")
コード例 #14
0
async def ytp(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"SEARCHING FOR `{query}` ON YT")
    try:
        results = YoutubeSearch(query, max_results=1).to_dict()
        link = f"https://youtube.com{results[0]['url_suffix']}"
        title = results[0]["title"]
        thumbnail = results[0]["thumbnails"][0]
        duration = results[0]["duration"]
        views = results[0]["views"]
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English.")
        is_playing = False
        print(str(e))
        return
    file_path = await convert(download(link))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ QUEUED AT POSITION {position}."
                            )
    else:
        await res.edit_text(
            "⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ PLAYING [☺️](https://telegra.ph/file/9ae661b212ecce3ecf1a1.jpg)"
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
    await res.edit("Processing Thumbnail.")
    await generate_cover(requested_by, title, views, duration, thumbnail)
    res.delete
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Playing `{query}` Via YouTube",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("watch on Youtube", url=link)]]),
        parse_mode="markdown",
    )
    os.remove("final.png")
コード例 #15
0
async def jiosaavn(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(
        f"⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ SEARCHING `{query}` ON JIO SAAVAN")
    try:
        async with aiohttp.ClientSession() as session:
            async with session.get(
                    f"https://jiosaavnapi.bhadoo.uk/result/?query={query}"
            ) as resp:
                r = json.loads(await resp.text())
        sname = r[0]["song"]
        slink = r[0]["media_url"]
        ssingers = r[0]["singers"]
        sthumb = r[0]["image"]
        sduration = int(r[0]["duration"])
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English.")
        print(str(e))
        is_playing = False
        return
    file_path = await convert(wget.download(slink))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ QUEUED AT POSTION{position}.")
    else:
        await res.edit_text("⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ PLAYING")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
    await res.edit("Processing Thumbnail.")
    await generate_cover_square(requested_by, sname, ssingers, sduration,
                                sthumb)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Playing {sname} ⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ VIA JIO SAAVAN",
        photo="final.png",
    )
    os.remove("final.png")
コード例 #16
0
async def ytp(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(
        f"Beta ruko jara sabar karo, dhund rahe hain `{query}` You Tube pe")
    try:
        results = YoutubeSearch(query, max_results=1).to_dict()
        link = f"https://youtube.com{results[0]['url_suffix']}"
        title = results[0]["title"]
        thumbnail = results[0]["thumbnails"][0]
        duration = results[0]["duration"]
        views = results[0]["views"]
    except Exception as e:
        await res.edit(
            "7vi fail ho ka bacha? Likhna sikho phir thik se naam likhana gaane ka....Found Literally Nothing!"
        )
        is_playing = False
        print(str(e))
        return
    file_path = await convert(download(link))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"Koi dhakka mukki nahi karega, apka number hai {position}.")
    else:
        await res.edit_text("Ok sur, apka ganna baja rahe hain aab")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Generating Thumbnail.")
    await generate_cover(requested_by, title, views, duration, thumbnail)
    res.delete
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=
        f"Baithe kya ho, Sab Nacho apka ganna baaj raha hai `{query}` Via [🚩༺★Yogi Thanos Baba★༻🚩 Bot Network](https://t.me/ThanosAssistant_Bot)",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("Watch on youtube", url=link)]]),
        parse_mode="markdown",
    )
    os.remove("final.png")
コード例 #17
0
ファイル: play.py プロジェクト: Sur-vivor/VCPlayerBot
async def jiosaavn(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"Arama Yapılıyor🔍 `{query}` jio saavn")
    try:
        async with aiohttp.ClientSession() as session:
            async with session.get(
                    f"https://jiosaavnapi.bhadoo.uk/result/?query={query}"
            ) as resp:
                r = json.loads(await resp.text())
        sname = r[0]["song"]
        slink = r[0]["media_url"]
        ssingers = r[0]["singers"]
        sthumb = r[0]["image"]
        sduration = int(r[0]["duration"])
    except Exception as e:
        await res.edit(
            "Kelimenin tam anlamıyla hiçbir şey bulamadım!, Türkçe üzerinde çalışmalısınız."
        )
        print(str(e))
        is_playing = False
        return
    file_path = await convert(wget.download(slink))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"Wyline=#️⃣ Konumda sıraya alındı {position}.")
    else:
        await res.edit_text("Wyline=▶️ Çalınıyor...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Küçük Resim Oluşturuluyor.")
    await generate_cover_square(requested_by, sname, ssingers, sduration,
                                sthumb)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Çalınıyor {sname} [Jiosaavn](https://t.me/WylineVoiceHelp)",
        photo="final.png",
    )
    os.remove("final.png")
コード例 #18
0
async def ytp(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"Searching.... `{query}` on You Tube")
    try:
        results = YoutubeSearch(query, max_results=1).to_dict()
        link = f"https://youtube.com{results[0]['url_suffix']}"
        title = results[0]["title"]
        thumbnail = results[0]["thumbnails"][0]
        duration = results[0]["duration"]
        views = results[0]["views"]
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English.")
        is_playing = False
        print(str(e))
        return
    file_path = await convert(download(link))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"✯𝗗𝗘𝗡𝗩𝗜𝗟✯=#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("✯𝗗𝗘𝗡𝗩𝗜𝗟✯=▶️ Playing.... Song")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Generating Thumbnail.")
    await generate_cover(requested_by, title, views, duration, thumbnail)
    res.delete
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=
        f"Playing `{query}` Via [YouTube](https://t.me/MusicBotEnjoy_group)",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("music group join",
                                 url="https://t.me/MusicBotEnjoy_group")
        ]]),
        parse_mode="markdown",
    )
    os.remove("final.png")
コード例 #19
0
async def ytp(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id=message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"Aranıyor `{query}`  You Tube")
    try:
        results = YoutubeSearch(query, max_results=1).to_dict()
        link = f"https://youtube.com{results[0]['url_suffix']}"
        title = results[0]["title"]
        thumbnail = results[0]["thumbnails"][0]
        duration = results[0]["duration"]
        views = results[0]["views"]
    except Exception as e:
        await res.edit(
            "Kelimenin tam anlamıyla hiçbir şey bulamadım!"
        )
        is_playing = False
        print(str(e))
        return
    file_path = await convert(download(link))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"✯𝗕𝗼𝘁✯=#️⃣ Sıraya alındı. Sırası = {position}.")
    else:
        await res.edit_text("✯𝗕𝗼𝘁✯=▶️ Oynatılıyor....")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Generating Thumbnail.")
    await generate_cover(requested_by, title, views, duration, thumbnail)
    res.delete
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Playing `{query}` Via [YouTube](https://t.me/Saygisizlar)",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("Watch on youtube", url=link)]]
        ),
        parse_mode="markdown",
    )
    os.remove("final.png")
コード例 #20
0
ファイル: play.py プロジェクト: khayal-0508/Khan_MusicBot
async def jiosaavn(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id=message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"Searching for `{query}` on jio saavn")
    try:
        async with aiohttp.ClientSession() as session:
            async with session.get(
                f"https://jiosaavnapi.bhadoo.uk/result/?query={query}"
            ) as resp:
                r = json.loads(await resp.text())
        sname = r[0]["song"]
        slink = r[0]["media_url"]
        ssingers = r[0]["singers"]
        sthumb = r[0]["image"]
        sduration = int(r[0]["duration"])
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English."
        )
        print(str(e))
        is_playing = False
        return
    file_path= await convert(wget.download(slink))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁=#️⃣ Hazırlanır... {position}.")
    else:
        await res.edit_text("𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁=▶️ Oxuyur.....")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Generating Thumbnail.")
    await generate_cover_square(requested_by, sname, ssingers, sduration, sthumb)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Oxunur {sname}  [Jiosaavn](https://t.me/KhanVlog) vasitəsilə",
        photo="final.png",
    )
    os.remove("final.png")
コード例 #21
0
ファイル: play.py プロジェクト: khayal-0508/Khan_MusicBot
async def ytp(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id=message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"YouTube-da `{query}` axtarılır")
    try:
        results = YoutubeSearch(query, max_results=1).to_dict()
        link = f"https://youtube.com{results[0]['url_suffix']}"
        title = results[0]["title"]
        thumbnail = results[0]["thumbnails"][0]
        duration = results[0]["duration"]
        views = results[0]["views"]
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English."
        )
        is_playing = False
        print(str(e))
        return
    file_path = await convert(download(link))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁=#️⃣ Hazırlanır... {position}.")
    else:
        await res.edit_text("𝗞𝗵𝗮𝗻 𝗠𝘂𝘀𝗶𝗰 𝗕𝗼𝘁=▶️ Oxuyur....")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Generating Thumbnail.")
    await generate_cover(requested_by, title, views, duration, thumbnail)
    res.delete
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Oxunur `{query}`  [YouTube](https://t.me/KhanVlog) vasitəsilə",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("YouTube-da bax", url=link)]]
        ),
        parse_mode="markdown",
    )
    os.remove("final.png")
コード例 #22
0
ファイル: play.py プロジェクト: edguru/devilsmusic-2.0
async def jiosaavn(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id=message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"Searching 🔍🔎🔍🔎 for `{query}` on jio saavn")
    try:
        async with aiohttp.ClientSession() as session:
            async with session.get(
                f"https://jiosaavnapi.bhadoo.uk/result/?query={query}"
            ) as resp:
                r = json.loads(await resp.text())
        sname = r[0]["song"]
        slink = r[0]["media_url"]
        ssingers = r[0]["singers"]
        sthumb = r[0]["image"]
        sduration = int(r[0]["duration"])
    except Exception as e:
        await res.edit(
            "Found Literally Nothing!, You Should Work On Your English."
        )
        print(str(e))
        is_playing = False
        return
    file= await convert(wget.download(slink))
    if message_.chat.id in tgcalls.GroupsOn:
        position = sira.add(message_.chat.id, file)
        await res.edit_text(f"#️⃣ Queued at position {position}.")
    else:
        await res.edit_text("▶️ Playing...")
        tgcalls.setsong(message_.chat.id, file)
    await res.edit("Processing Thumbnail.")
    await generate_cover_square(requested_by, sname, ssingers, sduration, sthumb)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Playing {sname} Via Jiosaavn",
        photo="final.png",
    )
    os.remove("final.png")
コード例 #23
0
ファイル: play.py プロジェクト: Sur-vivor/VCPlayerBot
async def ytp(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    chat_id = message_.chat.id
    text = message_.text.split(" ", 1)
    query = text[1]
    res = await message_.reply_text(f"Arama🔍 Yapılıyor `{query}` You Tube")
    try:
        results = YoutubeSearch(query, max_results=1).to_dict()
        link = f"https://youtube.com{results[0]['url_suffix']}"
        title = results[0]["title"]
        thumbnail = results[0]["thumbnails"][0]
        duration = results[0]["duration"]
        views = results[0]["views"]
    except Exception as e:
        await res.edit(
            "Kelimenin tam anlamıyla hiçbir şey bulamadım!, Türkçe üzerinde çalışmalısınız."
        )
        is_playing = False
        print(str(e))
        return
    file_path = await convert(download(link))
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"Wyline=#️⃣ Konumda sıraya alındı {position}.")
    else:
        await res.edit_text("Wyline=▶️Çalınıyor...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.edit("Küçük Resim Oluşturuluyor.")
    await generate_cover(requested_by, title, views, duration, thumbnail)
    res.delete
    m = await client.send_photo(
        chat_id=message_.chat.id,
        caption=f"Çalıyor `{query}` [YouTube](https://t.me/WylineVoiceHelp)",
        photo="final.png",
        reply_markup=InlineKeyboardMarkup(
            [[InlineKeyboardButton("Youtube'de izleyin", url=link)]]),
        parse_mode="markdown",
    )
    os.remove("final.png")
コード例 #24
0
async def deezer(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = await message_.reply_text(
        f"SEARCHING ⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ `{queryy}` ON DEEZER")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Found Literally Nothing, You Should Work On Your English!")
        is_playing = False
        return
    file_path = await convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover_square(requested_by, title, artist, duration,
                                thumbnail)
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        await res.edit("adding in queue")
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ QUEUED AT POSTIOJ {position}.")
    else:
        await res.edit_text(
            "⎳𝙀𝙇𝙄𝙕𝘼⏤͟͟͞͞★ʳᶱᵇ⁰ᶤ PLAYING ON VC [☺️](https://telegra.ph/file/9ae661b212ecce3ecf1a1.jpg)"
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path, 48000,
                                          tgcalls.pytgcalls.get_cache_peer())
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="final.png",
        caption=f"Playing [{title}]({url}) Via Deezer.")
    os.remove("final.png")
コード例 #25
0
ファイル: play.py プロジェクト: Sur-vivor/VCPlayerBot
async def deezer(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = await message_.reply_text(f"Arama Yapılıyor🔍 `{queryy}` deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Kelimenin tam anlamıyla hiçbir şey bulamadım, Türkçe üzerinde çalışmalısınız!"
        )
        is_playing = False
        return
    file_path = await convert(wget.download(url))
    await res.edit("Küçük Resim Oluşturuluyor")
    await generate_cover_square(requested_by, title, artist, duration,
                                thumbnail)
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        await res.edit("adding in queue")
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"Wyline=#️⃣ Konumda sıraya alındı {position}.")
    else:
        await res.edit_text("Wyline=▶️ Çalınıyor...")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="final.png",
        caption=
        f"Çalınıyor [{title}]({url}) [Deezer](https://t.me/WylineVoiceHelp).")
    os.remove("final.png")
コード例 #26
0
async def deezer(client: Client, message_: Message):
    requested_by = message_.from_user.first_name
    text = message_.text.split(" ", 1)
    queryy = text[1]
    res = await message_.reply_text(f"Searching for `{queryy}` on deezer")
    try:
        arq = ARQ("https://thearq.tech")
        r = await arq.deezer(query=queryy, limit=1)
        title = r[0]["title"]
        duration = int(r[0]["duration"])
        thumbnail = r[0]["thumbnail"]
        artist = r[0]["artist"]
        url = r[0]["url"]
    except:
        await res.edit(
            "Kelimenin tam anlamıyla hiçbir şey bulamadım, İngilizceniz üzerinde çalışmalısınız!"
        )
        is_playing = False
        return
    file_path= await convert(wget.download(url))
    await res.edit("Generating Thumbnail")
    await generate_cover_square(requested_by, title, artist, duration, thumbnail)
    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        await res.edit("adding in queue")
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"✯𝗕𝗼𝘁✯=#️⃣ Sıraya alındı. Sırası = {position}.")
    else:
        await res.edit_text("✯𝗕𝗼𝘁✯=▶️ Oynatılıyor.....")
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
    await res.delete()
    m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="final.png",
        caption=f"Oynatılıyor [{title}]({url}) Via [Deezer](https://t.me/Saygisizlar)."
    ) 
    os.remove("final.png")
コード例 #27
0
ファイル: __main__.py プロジェクト: edguru/devilsmusic-2.0
async def pl(__, _):
    if _.chat.id in group_call_instances.GroupsOn:
        sira.add(_.chat.id, 'out.raw')
    else:
        await group_call_instances.setsong(_.chat.id, 'out.raw')
コード例 #28
0
async def play(client: Client, message_: Message):
    audio = (message_.reply_to_message.audio or message_.reply_to_message.voice
             ) if message_.reply_to_message else None
    chat_id = message_.chat.id
    res = await message_.reply_text("Ok sur, apka ganna 🔄Processing ho raha..."
                                    )

    if audio:
        if round(audio.duration / 60) > DURATION_LIMIT:
            raise DurationLimitError(
                f"Videos longer than {DURATION_LIMIT} minute(s) aren't allowed, the provided video is {audio.duration / 60} minute(s)"
            )

        file_name = audio.file_id + audio.file_name.split(".")[-1]
        file_path = await convert(await
                                  message_.reply_to_message.download(file_name)
                                  )
    else:
        messages = [message_]
        text = ""
        offset = None
        length = None

        if message_.reply_to_message:
            messages.append(message_.reply_to_message)

        for message in messages:
            if offset:
                break

            if message.entities:
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text(
                "❕Nashe me ho ka bacha? ganne ka naam toh daal.")
            return

        url = text[offset:offset + length]

        file_path = await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(
            f"Beta ruko jara sabar karo apka number hai {position}.")
    else:
        await res.edit_text("Ok sur, apka ganna baja rahe hain aab")
        res.delete
        m = await client.send_photo(
            chat_id=message_.chat.id,
            photo="Others/thumbnail2.png",
            reply_markup=InlineKeyboardMarkup([[
                InlineKeyboardButton("Support⚡️",
                                     url="https://t.me/ThanosAssistant_Bot")
            ]]),
            caption=
            f"Playing Your song Via  [🚩༺★Yogi Thanos Baba★༻🚩 Bot Network](https://t.me/ThanosAssistant_Bot).",
        )
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)
コード例 #29
0
ファイル: play.py プロジェクト: kusalCY/VC-Player
                for entity in message.entities:
                    if entity.type == "url":
                        text = message.text or message.caption
                        offset, length = entity.offset, entity.length
                        break

        if offset == None:
            await res.edit_text("❕ You did not give me anything to play.")
            return

        url = text[offset:offset+length]

        file_path =await convert(download(url))

    if message_.chat.id in tgcalls.pytgcalls.active_calls:
        position = sira.add(message_.chat.id, file_path)
        await res.edit_text(f"song in #️⃣ Queued at position {position}.")
    else:
        await res.edit_text("Song is ▶️ Playing...")
        res.delete
        m = await client.send_photo(
        chat_id=message_.chat.id,
        photo="https://telegra.ph/%F0%9D%91%AA%F0%9D%92%9A%F0%9D%92%83%F0%9D%92%86%F0%9D%92%93-%F0%9D%91%BD%F0%9D%91%AA-04-07",
        caption=f"Playing Your song Via  [CyberPlayer](https://t.me/Cyber0Hacker).",
         ) 
        tgcalls.pytgcalls.join_group_call(message_.chat.id, file_path)


#---------------------------------DEEZER------------------------------------------------------------------
@Client.on_message(
    filters.command("deezer")