示例#1
0
from pyrogram.types import Message, Voice

from callsmusic import callsmusic, queues

import converter
from downloaders import youtube

from config import BOT_NAME as bn, DURATION_LIMIT
from helpers.filters import command, other_filters
from helpers.decorators import errors
from helpers.errors import DurationLimitError
from helpers.gets import get_url, get_file_name
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup


@Client.on_message(command("reply") & other_filters)
@errors
async def play(_, message: Message):

    lel = await message.reply("🔄 **Sedang Proses**...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="📜 Manual",
                             url='https://telegra.ph/Music-Bot-Command-04-15'),
        InlineKeyboardButton(text="Channel 🔔", url='https://t.me/TokaiProject')
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
示例#2
0
@Client.on_message(filters.command('adminreset'))
async def update_admin(client, message):
    global a
    admins = await client.get_chat_members(message.chat.id,
                                           filter="administrators")
    new_ads = []
    for u in admins:
        new_ads.append(u.user.id)
    a[message.chat.id] = new_ads
    await message.reply_text(
        'Berhasil Memperbarui Daftar Admin di **{}**'.format(
            message.chat.title))


@Client.on_message(command("pause") & other_filters)
@errors
@authorized_users_only
async def pause(_, message: Message):
    if (message.chat.id not in callsmusic.pytgcalls.active_calls) or (
            callsmusic.pytgcalls.active_calls[message.chat.id] == 'paused'):
        await message.reply_text("❌ Tidak Ada Lagu Yang Sedang Diputar.")
    else:
        callsmusic.pytgcalls.pause_stream(message.chat.id)
        await message.reply_text("▶️ ♬ Pause.")


@Client.on_message(command("resume") & other_filters)
@errors
@authorized_users_only
async def resume(_, message: Message):
示例#3
0
from asyncio import QueueEmpty

from pyrogram import Client
from pyrogram.types import Message

from callsmusic import callsmusic, queues
import asyncio
from helpers.filters import command
from helpers.decorators import errors, authorized_users_only
from helpers.player import play_song


@Client.on_message(command(["pause", "p"]))
@errors
@authorized_users_only
async def pause(_, message: Message):
    if callsmusic.pause(message.chat.id):
        await message.reply_text("⏸ Paused")
    else:
        await message.reply_text("❗️ Nothing is playing")


@Client.on_message(command(["resume", "r"]))
@errors
@authorized_users_only
async def resume(_, message: Message):
    if callsmusic.resume(message.chat.id):
        await message.reply_text("🎧 Resumed")
    else:
        await message.reply_text("❗️ Nothing is paused")
示例#4
0
from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton

from helpers.filters import command
# from helpers.decorators import authorized_users_only


@Client.on_message(command("start"))
async def start(_, message: Message):
    await message.reply_text(
        f"""<b>👋🏻 Hi {message.from_user.first_name}!</b>

I am MusiCeros, an open-source bot that lets you play music in your groups.

Use the buttons below to know more about me.""",
        reply_markup=InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        "⚒ Don't Click", text="Just Stay Away"
                    )
                ],
            ]
        )
    )
示例#5
0
from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton

from helpers.filters import command, other_filters, other_filters2


@Client.on_message(command(["search", "search@VCPlay_Robot"]) & other_filters)
async def search(_, message: Message):
    await message.reply_text(
        "💁🏻‍♂️ Do you want to search for a YouTube video?",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("✅ Yes", switch_inline_query_current_chat=""),
            InlineKeyboardButton("No ❌", callback_data="close")
        ]]))


@Client.on_message(command("search") & other_filters2)
async def search_(_, message: Message):
    await message.reply_text("❕ This command works in groups only")
示例#6
0
from pyrogram import Client
from pyrogram.types import Message

from helpers.filters import command
from helpers.decorators import errors, full_users_only, super_users_only, group_users_only
from helpers.db import DBHandler, AdminType

dbhd = DBHandler()


@Client.on_message(command(["admin", "ad"]))
@errors
@full_users_only
async def addadmin(client, message: Message):
    user_id = 0
    if message.reply_to_message:
        user_id = message.reply_to_message.from_user.id
        await dbhd.set_admtype(user_id, AdminType.GROUP.value, message.chat.id)
        await client.send_message(
            message.chat.id,
            f"@{message.reply_to_message.from_user.username} is admin now")
    else:
        user_tags = message.text.replace("@", "").split(" ")
        user_tags.pop(0)
        for user in await client.get_users(user_tags):
            await dbhd.set_admtype(user.id, AdminType.GROUP.value,
                                   message.chat.id)
            await client.send_message(message.chat.id,
                                      f"@{user.username} is admin now")

示例#7
0
from pyrogram import Client, filters  # Ik this is weird as this shit is already imported in line 6! anyway ... F**k Off!
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, Chat

from helpers.filters import command, other_filters, other_filters2
from helpers.database import db, Database
from helpers.dbthings import handle_user_status
from config import LOG_CHANNEL, BOT_USERNAME, UPDATES_CHANNEL


@Client.on_message(filters.private)
async def _(bot: Client, cmd: Message):
    await handle_user_status(bot, cmd)


@Client.on_message(command(["start", f"start@{BOT_USERNAME}"]))
async def start(_, message: Message):
    usr_cmd = message.text.split("_")[-1]
    if usr_cmd == "/start":
        chat_id = message.chat.id
        if not await db.is_user_exist(chat_id):
            await db.add_user(chat_id)
            await Client.send_message(
                chat_id=LOG_CHANNEL,
                text=
                f"**📢 News ** \n#New_Music_Lover **Started To Using Meh!** \n\nFirst Name: `{message.from_user.first_name}` \nUser ID: `{message.from_user.id}` \nProfile Link: [{message.from_user.first_name}](tg://user?id={message.from_user.id})",
                parse_mode="markdown")
    await message.reply_text(
        f"""<b>Hi {message.from_user.mention} 😉️!</b>

I'm The Nexa Music Bot! A Powerful Bot to Play Music in Your Group Voice Chat 😇!
示例#8
0
import queue

from pyrogram import Client
from pyrogram.types import Message

import callsmusic

import queues
import cache.admins

from helpers.filters import command, other_filters, other_filters2
from helpers.wrappers import errors, admins_only


@Client.on_message(command(["pause", "pause@Mahi_bhai_7_bot"]) & other_filters)
@errors
@admins_only
async def pause(_, message: Message):
    if (message.chat.id not in callsmusic.pytgcalls.active_calls) or (
            callsmusic.pytgcalls.active_calls[message.chat.id] == 'paused'):
        await message.reply_text("❕ Nothing is playing.")
    else:
        callsmusic.pytgcalls.pause_stream(message.chat.id)
        await message.reply_text("⏸ Paused.")


@Client.on_message(command("pause") & other_filters2)
async def pause_(_, message: Message):
    await message.reply_text("❕ This command works in groups only")

示例#9
0
from asyncio.queues import QueueEmpty

from pyrogram import Client, filters
from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
from pyrogram.types import Message
from callsmusic import callsmusic
from callsmusic.callsmusic import client as user

from helpers.filters import command, other_filters
from helpers.decorators import errors, authorized_users_only, admin_only

import cache.admins


@Client.on_message(command("pause") & other_filters)
@errors
@authorized_users_only
async def pause(_, message: Message):
    if message.chat.id not in callsmusic.pytgcalls.active_calls:
        await message.reply("❗ Tidak ada lagu yang diputar")
    if callsmusic.pytgcalls.active_calls[message.chat.id] == 'paused':
        await message.reply("❗ Lagu sudah dijeda sebelumnya!")
    else:
        callsmusic.pytgcalls.pause_stream(message.chat.id)
        await message.reply_text("▶️ Dijeda!")


@Client.on_message(command("resume") & other_filters)
@errors
@authorized_users_only
async def resume(_, message: Message):
示例#10
0
from pyrogram import Client
from pyrogram.types import Message, Voice

import callsmusic

import converter
import youtube
import queues

from config import DURATION_LIMIT
from helpers.errors import DurationLimitError
from helpers.filters import command
from helpers.wrappers import errors


@Client.on_message(command(["play", "play@Mahi_bhai_7_bot"]))
@errors
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None

    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_unique_id + "." + (audio.file_name.split(
            ".")[-1] if not isinstance(audio, Voice) else "ogg")
示例#11
0
from pyrogram import Client, filters
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton

from config import BOT_NAME as bn
from helpers.filters import command, other_filters2, other_filters


@Client.on_message(command("help") & other_filters2)
async def helper(ok, message: Message):
    await message.reply_text(
        f"""💞 Hello! Following are the commands available for **{bn}** - __A Group Voice Chat Music Player__.
The commands I currently support are:

🔥 **Users Commands :**
⚜️ /play - **[ Groups Only ]** > __Plays the replied audio file or YouTube video through link.__
⚜️ /song - **[ Groups & DM ]** > __Uploads the searched song in the chat.__
⚜️ /ytplay - **[ Groups Only ]** > __Plays the song directly from YouTube Search.__
⚜️ /repo - **[ DM Only ]** > __Gets the source code and YouTube Tutorial Video.__


🔰 **Admin & Sudo Users Commands :**
⚜️ /pause - **[Groups Only ]** > __Pause Voice Chat Music.__
⚜️ /resume - **[Groups Only ]** > __Resume Voice Chat Music.__
⚜️ /skip - **[Groups Only ]** > __Skips the current Music Playing In Voice Chat.__
⚜️ /stop - **[Groups Only ]** > __Clears The Queue as well as ends Voice Chat Music.__"""
    )


@Client.on_message(command("help") & other_filters)
async def ghelp(_, message: Message):
    await message.reply_text(
示例#12
0
import os

import youtube_dl
from youtube_search import YoutubeSearch
import requests

from helpers.filters import command, other_filters2, other_filters
from helpers.decorators import errors

from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, Voice

from config import BOT_NAME as bn, PLAY_PIC


@Client.on_message(command("start") & other_filters2)
async def start(_, message: Message):
    hell_pic = PLAY_PIC
    hell = f"Ben **{bn}** !!\nGrubun sesli sohbetinde müzik çalmana izin verdim. 😉\nTüm komutları ve açıklamalarını almak için /help\n\nMüzik Akışı keyfini çıkarın 😉"
    butts = InlineKeyboardMarkup(
        [
            [
                InlineKeyboardButton(
                    "Sohbet Grup 💬", url="https://t.me/RgSohbet"
                ),
                InlineKeyboardButton(
                    "Kanal 📣", url="https://t.me/RgChannell"
                )
            ]
        ]
    )
示例#13
0
import os

import youtube_dl
from youtube_search import YoutubeSearch
import requests

from helpers.filters import command, other_filters2
from helpers.decorators import errors
from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, Voice

from config import BOT_NAME as bn


@Client.on_message(command("start") & other_filters2)
async def start(_, message: Message):
    await message.reply_text(
        f'I am **Ohto** !! I can play music for you in your voice chat!!, send /help for command list...\nAdd me and @RikaKaawaai and then use me!![... ](https://telegra.ph/file/ff0b5f2df191253feb199.jpg)', parse_mode = "markdown", 
        reply_markup=InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        "Add me to your group", url="https://t.me/OhtoAiPlaysBot?startgroup=True"
                    )],[
                    InlineKeyboardButton(text = "My Owner", url = "https://t.me/DontKnowWhoRU")
                ]
            ]
        )
    )

@Client.on_message(command("help") & other_filters2)
示例#14
0
                "⏸ Pause ⏸", callback_data="cbpause"
            ),
            InlineKeyboardButton(
                "⏩ Skip ⏩", callback_data="cbskip"
            ),
        ],
        [
            InlineKeyboardButton(
                "❌ Close ❌", callback_data="close"
            )
        ]
    ]
)


@Client.on_message(command(["play", f"play@{BOT_USERNAME}"]) & other_filters)
@errors
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice) if message.reply_to_message else None

    response = await message.reply_text("**Processing Your Song 😇...**")

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

        file_name = audio.file_unique_id + "." + (
            (
                audio.file_name.split(".")[-1]
示例#15
0
import queue

from pyrogram import Client
from pyrogram.types import Message

import callsmusic

import queues
import cache.admins

from helpers.filters import command
from helpers.wrappers import errors, admins_only


@Client.on_message(command(["pause", "p"]))
@errors
@admins_only
async def pause(_, message: Message):
    if (message.chat.id not in callsmusic.pytgcalls.active_calls) or (
            callsmusic.pytgcalls.active_calls[message.chat.id] == 'paused'):
        await message.reply_text("❕ Tidak Ada Lagu Yang Di-Putar!.")
    else:
        callsmusic.pytgcalls.pause_stream(message.chat.id)
        await message.reply_text("⏸ Lagumu Sudah Dijeda/Dihentikan Sementara!."
                                 )


@Client.on_message(command(["resume", "r"]))
@errors
@admins_only
async def resume(_, message: Message):
示例#16
0
import queue

from pyrogram import Client
from pyrogram.types import Message

import callsmusic

import queues
import cache.admins

from helpers.filters import command
from helpers.wrappers import errors, admins_only


@Client.on_message(command(["pause", "p"]))
@errors
@admins_only
async def pause(_, message: Message):
    if (message.chat.id not in callsmusic.pytgcalls.active_calls) or (
            callsmusic.pytgcalls.active_calls[message.chat.id] == 'paused'):
        await message.reply_text("❕ Hiçbir şey çalmıyor.")
    else:
        callsmusic.pytgcalls.pause_stream(message.chat.id)
        await message.reply_text("⏸ Durduruldu.")


@Client.on_message(command(["resume", "r"]))
@errors
@admins_only
async def resume(_, message: Message):
    if (message.chat.id not in callsmusic.pytgcalls.active_calls) or (
示例#17
0
from pyrogram.types import Message

from callsmusic import callsmusic, queues

from converter import converter
from downloaders import youtube

from config import DURATION_LIMIT
from helpers.filters import command, other_filters
from helpers import decorators
from helpers.errors import DurationLimitError
from helpers.gets import get_url, get_file_name
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup


@Client.on_message(command("music") & other_filters)
@decorators.errors
async def play(_, message: Message):
    lel = await message.reply("🔄 **Memproses** lagu...")

    keyboard = InlineKeyboardMarkup(
        [
            [
                InlineKeyboardButton(
                    text="🔊 Channel",
                    url="https://t.me/InfoOfAllBot")

            ]
        ]
    )
示例#18
0
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram import Client, filters

from youtube_search import YoutubeSearch

from helpers.filters import command

logging.basicConfig(
    level=logging.DEBUG,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
logger = logging.getLogger(__name__)

logging.getLogger("pyrogram").setLevel(logging.WARNING)


@Client.on_message(command("search"))
async def ytsearch(_, message: Message):
    if filters.private:
        await message.reply("Gunakan ini hanya dalam grup")
    try:
        if len(message.command) < 2:
            await message.reply(
                "Jika anda ingin mencari via inline, tekan tombol Cari di Youtube atau ketikan /search + nama lagu",
                reply_markup=InlineKeyboardMarkup([[
                    InlineKeyboardButton("Cari di Youtube",
                                         switch_inline_query_current_chat="")
                ]]))
            return
        query = message.text.split(None, 1)[1]
        m = await message.reply_text("Mencari....")
        results = YoutubeSearch(query, max_results=4).to_dict()
示例#19
0
from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton

from helpers.filters import command


@Client.on_message(command(["start", "start@Mahi_bhai_7_bot"]))
async def start(_, message: Message):
    await message.reply_text(
        f"""<b>ЁЯСЛЁЯП╗ Hi {message.from_user.first_name}!</b>
I am @Mahi_bhai_7_bot an open-source bot that lets you play music in your Telegram groups.
Use the buttons below to know more about me.
Use /help for more info""",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("тЪбя╕ПOwnerтЪбя╕П",
                                 url="https://t.me/Mahi_bhai_7")
        ], [
            InlineKeyboardButton("Assistant", url="https://t.me/Mahi_bhai_007")
        ]]))
示例#20
0
from pyrogram import Client
from pyrogram.types import Message, Voice

import callsmusic

import converter
import youtube
import queues

from config import DURATION_LIMIT
from helpers.errors import DurationLimitError
from helpers.filters import command
from helpers.wrappers import errors


@Client.on_message(command(["play", "play@VCPlay_Robot"]))
@errors
async def play(_, message: Message):
    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None

    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_unique_id + "." + (audio.file_name.split(
            ".")[-1] if not isinstance(audio, Voice) else "ogg")
示例#21
0
from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton

from helpers.filters import command, other_filters, other_filters2


@Client.on_message(
    command(["search", "search@Mahi_bhai_7_bot"]) & other_filters)
async def search(_, message: Message):
    await message.reply_text(
        "💁🏻‍♂️ Do you want to search for a YouTube video?",
        reply_markup=InlineKeyboardMarkup([[
            InlineKeyboardButton("✅ Yes", switch_inline_query_current_chat=""),
            InlineKeyboardButton("No ❌", callback_data="close")
        ]]))


@Client.on_message(command("search") & other_filters2)
async def search_(_, message: Message):
    await message.reply_text("❕ This command works in groups only")
示例#22
0
import os

import youtube_dl
from youtube_search import YoutubeSearch
import requests

from helpers.filters import command, other_filters2, other_filters
from helpers.decorators import errors

from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, Voice

from config import BOT_NAME as bn, PLAY_PIC


@Client.on_message(command("start") & other_filters2)
async def start(_, message: Message):
    hell_pic = PLAY_PIC
    hell = f"Ben **{bn}** !!\nGrubunuzun sesli sohbetinde müzik çalmanıza yardımcı oluyorum 😉\nTüm komutları ve açıklamalarını almak için  /help\n\nİyi dinlemeler 😉"
    butts = InlineKeyboardMarkup(
        [
            [
                InlineKeyboardButton(
                    "Destek Grubu 💬", url="https://t.me/zevzekcalardestekgrup"
                ),
                InlineKeyboardButton(
                    "Destek & Guncelleme Kanalı 📣", url="https://t.me/zevzekcalardestek"
                )
            ]
        ]
    )
示例#23
0
from pyrogram.types import Message, Voice
from youtube_search import YoutubeSearch
from callsmusic import callsmusic, queues

import converter
from downloaders import youtube

from config import BOT_NAME as bn, DURATION_LIMIT
from helpers.filters import command, other_filters
from helpers.decorators import errors
from helpers.errors import DurationLimitError
from helpers.gets import get_url, get_file_name
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup


@Client.on_message(command("ytp") & other_filters)
@errors
async def play(_, message: Message):

    lel = await message.reply("🔎 **SEDANG MENCARI LAGUMU!...**")
    sender_id = message.from_user.id
    user_id = message.from_user.id
    sender_name = message.from_user.first_name
    user_name = message.from_user.first_name
    rpk = "[" + user_name + "](tg://user?id=" + str(user_id) + ")"

    query = ''
    for i in message.command[1:]:
        query += ' ' + str(i)
    print(query)
    await lel.edit("🎼 **MEMPROSES LAGUMU!...**")
示例#24
0
import converter
from downloaders import youtube

from config import BOT_NAME as bn, DURATION_LIMIT, PLAY_PIC
from helpers.filters import command, other_filters
from helpers.decorators import errors
from helpers.errors import DurationLimitError
from helpers.gets import get_url, get_file_name

from youtube_search import YoutubeSearch
from callsmusic import callsmusic, queues

from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message, Voice
from pyrogram import Client

@Client.on_message(command("oynat") & other_filters)
@errors
async def oynat(_, message: Message):

    lel = await message.reply(f"**{bn} :-** 🔄 İşleme alındı ...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name
    hell_pic = PLAY_PIC

    keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text="Müzik Kanalı 🎶",
                        url="https://t.me/bizbizemuzik")
                   
示例#25
0
                    f'- Melewati lagu\n- Sedang dimainkan **{qeue[0][0]}**')

    else:
        if chat_id in callsmusic.pytgcalls.active_calls:
            try:
                callsmusic.queues.clear(chat_id)
            except QueueEmpty:
                pass

            callsmusic.pytgcalls.leave_group_call(chat_id)
            await cb.message.edit('Berhasil Keluar dari Obrolan!')
        else:
            await cb.answer('Obrolan tidak terhubung!', show_alert=True)


@Client.on_message(command("mainkan") & other_filters)
async def play(_, message: Message):
    global que
    lel = await message.reply("🔄 **Sedang Memproses**")
    administrators = await get_administrators(message.chat)
    chid = message.chat.id
    usar = await USER.get_me()
    wew = usar.id
    for administrator in administrators:
        if administrator == message.from_user.id:
            try:
                invitelink = await _.export_chat_invite_link(chid)
            except:
                await lel.edit(
                    "<b>Tambahkan saya sebagai admin grup terlebih dahulu</b>",
                )
示例#26
0
from asyncio import QueueEmpty

from pyrogram import Client
from pyrogram.types import Message

from callsmusic import callsmusic, queues

from helpers.filters import command, other_filters
from helpers.decorators import errors, authorized_users_only


@Client.on_message(command("pause") & other_filters)
@errors
@authorized_users_only
async def pause(_, message: Message):
    if callsmusic.pause(message.chat.id):
        await message.reply_text("Paused!")
    else:
        await message.reply_text("Nothing is playing!")


@Client.on_message(command("resume") & other_filters)
@errors
@authorized_users_only
async def resume(_, message: Message):
    if callsmusic.resume(message.chat.id):
        await message.reply_text("Resumed!")
    else:
        await message.reply_text("Nothing is paused!")

示例#27
0
from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton

from helpers.filters import command, other_filters, other_filters2


@Client.on_message(command("start") & other_filters)
async def start(_, message: Message):
    await message.reply_text(
        f"""<b>👋🏻 Hi {message.from_user.first_name}!</b>

I am  Music Player  bot that lets you play music in your Telegram groups.

Use the buttons below to know more about me.""",
        reply_markup=InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        "owner", url="https:t.me/AwaIker96"
                    )
                ],
                [
                    InlineKeyboardButton(
                        "💬 Group", url="https://t.me/meiyduoffsti"
                    ),
                    InlineKeyboardButton(
                        "Channel 🔈", url="https://t.me/gjxilju"
                    )
                ]
            ]
        )
示例#28
0
import os

from pyrogram import Client
from pyrogram.types import Message, Voice

import youtube_dl
from youtube_search import YoutubeSearch
import requests

from config import BOT_NAME as Bn
from helpers.filters import command, other_filters
from helpers.decorators import errors


@Client.on_message(command("song") & other_filters)
@errors
async def a(client, message: Message):
    query = ''
    for i in message.command[1:]:
        query += ' ' + str(i)
    print(query)
    m = await message.reply(f"**{Bn} :-** 🔍 Searching For {query}")
    ydl_opts = {"format": "bestaudio[ext=m4a]"}
    try:
        results = []
        count = 0
        while len(results) == 0 and count < 6:
            if count > 0:
                time.sleep(1)
            results = YoutubeSearch(query, max_results=1).to_dict()
            count += 1
示例#29
0
    font = ImageFont.truetype("etc/font.otf", 32)
    draw.text((190, 550), f"Tɩtɭɘ : {title}", (255, 255, 255), font=font)
    draw.text((190, 590), f"Dʋʀʌtɩoŋ : {duration}", (255, 255, 255), font=font)
    draw.text((190, 630), f"Vɩɘws : {views}", (255, 255, 255), font=font)
    draw.text(
        (190, 670),
        f"Aɗɗɘɗ Bƴ : {requested_by}",
        (255, 255, 255),
        font=font,
    )
    img.save("final.png")
    os.remove("temp.png")
    os.remove("background.png")


@Client.on_message(command("play") & other_filters)
@errors
async def play(_, message: Message):

    lel = await message.reply("🔄 **Pʀocɘssɩŋʛ** soʋŋɗs...")
    sender_id = message.from_user.id
    sender_name = message.from_user.first_name

    keyboard = InlineKeyboardMarkup([[
        InlineKeyboardButton(text="Bot Owŋɘʀ", url="https://t.me/its_Hexor")
    ]])

    audio = (message.reply_to_message.audio or message.reply_to_message.voice
             ) if message.reply_to_message else None
    url = get_url(message)
示例#30
0
import os

from pyrogram import Client
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, Chat

from helpers.filters import command, other_filters, other_filters2

## ~ Simple Config ~ ##
FRIEND_BOT = "Achubiju6c"
USER_ACCNAME = os.getenv("USER_ACCNAME", "Achubiju6c")


@Client.on_message(command(["start", "start@YeageristMusic_bot"]))
async def start(_, message: Message):
    await message.reply_text(
        f"""<b>Hi {message.from_user.first_name} 😉️!</b>

I'm TheYeagerist Music Streamer Bot. Friend of **@{FRIEND_BOT}** 😏️.

I can play Music In Telegram Groups Via Voice Chat! 😌️.

Made with ❤️ <b>@Animemusicarchive6</b>""",
        reply_markup=
        InlineKeyboardMarkup([[
            InlineKeyboardButton(
                "🤨️ How To Use Me 🤨️",
                url=
                "https://telegra.ph/How-To-Use-Yeagerist-Music-Streamer-Bot-04-05"
            )
        ],
                              [