Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChampu committed Aug 30, 2024
2 parents 378d19e + 6731917 commit 4044d4f
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions ChampuXMusic/plugins/play/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@
warnings.filterwarnings("ignore", category=UserWarning, module="http.cookiejar")

@app.on_message(
filters.command(["play", "vplay", "cplay", "cvplay", "playforce", "vplayforce", "cplayforce", "cvplayforce"] ,prefixes=["/", "!", "%", ",", "", ".", "@", "#"])
filters.command(
[
"play",
"vplay",
"cplay",
"cvplay",
"playforce",
"vplayforce",
"cplayforce",
"cvplayforce",
],
prefixes=["/", "!", "%", ",", "", ".", "@", "#"],
)
& filters.group
& ~BANNED_USERS
)
Expand Down Expand Up @@ -168,7 +179,9 @@ async def play_commnd(
cap = _["play_10"]
elif "https://youtu.be" in url:
videoid = url.split("/")[-1].split("?")[0]
details, track_id = await YouTube.track(f"https://www.youtube.com/watch?v={videoid}")
details, track_id = await YouTube.track(
f"https://www.youtube.com/watch?v={videoid}"
)
streamtype = "youtube"
img = details["thumb"]
cap = _["play_11"].format(
Expand All @@ -186,7 +199,7 @@ async def play_commnd(
cap = _["play_11"].format(
details["title"],
details["duration_min"],
)
)
elif await Spotify.valid(url):
spotify = True
if not config.SPOTIFY_CLIENT_ID and not config.SPOTIFY_CLIENT_SECRET:
Expand Down Expand Up @@ -665,6 +678,7 @@ async def slider_queries(client, CallbackQuery, _):
media=med, reply_markup=InlineKeyboardMarkup(buttons)
)


__MODULE__ = "Play"
__HELP__ = """
`/play [song name/link]`: Play a song.
Expand All @@ -675,4 +689,4 @@ async def slider_queries(client, CallbackQuery, _):
`/vplayforce [video name/link]`: Force play a video.
`/cplayforce [channel song name/link]`: Force play a song in a channel.
`/cvplayforce [channel video name/link]`: Force play a video in a channel.
"""
"""

0 comments on commit 4044d4f

Please sign in to comment.