diff --git a/Dockerfile b/Dockerfile index 904bafd..72c0084 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9 +FROM nikolaik/python-nodejs:python3.9-nodejs17 RUN apt update && apt upgrade -y RUN apt install python3-pip -y diff --git a/MusicAndVideo/admins.py b/MusicAndVideo/admins.py index 39656d2..5301943 100644 --- a/MusicAndVideo/admins.py +++ b/MusicAndVideo/admins.py @@ -10,6 +10,7 @@ @Client.on_message(filters.command(["skip"], prefixes=f"{HNDLR}")) @authorized_users_only async def skip(client, m: Message): + await m.delete() chat_id = m.chat.id if len(m.command) < 2: op = await skip_current_song(chat_id) @@ -43,6 +44,7 @@ async def skip(client, m: Message): @Client.on_message(filters.command(["end", "stop"], prefixes=f"{HNDLR}")) @authorized_users_only async def stop(client, m: Message): + await m.delete() chat_id = m.chat.id if chat_id in QUEUE: try: @@ -58,6 +60,7 @@ async def stop(client, m: Message): @Client.on_message(filters.command(["pause"], prefixes=f"{HNDLR}")) @authorized_users_only async def pause(client, m: Message): + await m.delete() chat_id = m.chat.id if chat_id in QUEUE: try: @@ -74,6 +77,7 @@ async def pause(client, m: Message): @Client.on_message(filters.command(["resume"], prefixes=f"{HNDLR}")) @authorized_users_only async def resume(client, m: Message): + await m.delete() chat_id = m.chat.id if chat_id in QUEUE: try: diff --git a/MusicAndVideo/github.py b/MusicAndVideo/github.py index 9a1bb30..ba41684 100644 --- a/MusicAndVideo/github.py +++ b/MusicAndVideo/github.py @@ -8,8 +8,9 @@ @Client.on_message(filters.command(["git", "github"], prefixes=f"{HNDLR}")) @capture_err async def github(_, message): + await message.delete() if len(message.command) != 2: - await message.reply_text("/git Username") + await message.reply_text("• Harap masukkan username github yang valid") return username = message.text.split(None, 1)[1] URL = f"https://api.github.com/users/{username}" diff --git a/MusicAndVideo/helpers/handlers.py b/MusicAndVideo/helpers/handlers.py index eabcd87..b81f8e2 100644 --- a/MusicAndVideo/helpers/handlers.py +++ b/MusicAndVideo/helpers/handlers.py @@ -76,6 +76,6 @@ async def on_end_handler(_, update: Update): else: await bot.send_message( chat_id, - f"**šŸŽ§ Sekarang Memutar** \n[{op[0]}]({op[1]}) | `{op[2]}`", + f"**šŸŽ§ Sekarang Memutar** \n[{op[0]}]({op[1]}) | `{op[2]}`\n====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====", disable_web_page_preview=True, ) diff --git a/MusicAndVideo/play.py b/MusicAndVideo/play.py index 6850adb..216428a 100644 --- a/MusicAndVideo/play.py +++ b/MusicAndVideo/play.py @@ -1,4 +1,7 @@ +from __future__ import unicode_literals + import asyncio +import glob import random from pyrogram import Client, filters @@ -16,23 +19,8 @@ from config import HNDLR, bot, call_py from MusicAndVideo.helpers.queues import QUEUE, add_to_queue, get_queue -IMAGE = [ - "https://telegra.ph/file/cbdd8b864c39b394de8f6.jpg", - "https://telegra.ph/file/24126cf48ed2bc9f6ee60.jpg", - "https://telegra.ph/file/a47e868aa23969b827b02.jpg", - "https://telegra.ph/file/9e8adc4d38dc05e913fd1.jpg", - "https://telegra.ph/file/806b59d49aa0e326a3184.jpg", - "https://telegra.ph/file/83939bc9832dff8a83682.jpg", - "https://telegra.ph/file/2aef497654499534d94de.jpg", - "https://telegra.ph/file/c9715a3f7cf9bf18bfc42.jpg", - "https://telegra.ph/file/7141b55e33b69a434f8c5.jpg", - "https://telegra.ph/file/cbce4a97105ee1debdf91.jpg", - "https://telegra.ph/file/7001368a78193f179bd67.jpg", - "https://telegra.ph/file/1d1748506600b2da206c8.jpg", - "https://telegra.ph/file/d081b03640c7cb4247b17.jpg", -] - -IMAGE_THUMBNAIL = random.choice(IMAGE) +ambil_foto = glob.glob("MusicAndVideo/thumbnail/*") +image_thumbnail = random.choice(ambil_foto) # music player def ytsearch(query): @@ -125,14 +113,14 @@ async def play(client, m: Message): if chat_id in QUEUE: pos = add_to_queue(chat_id, songname, dl, link, "Audio", 0) await huehue.delete() - # await m.reply_to_message.delete() await m.reply_photo( photo="https://telegra.ph/file/d6f92c979ad96b2031cba.png", caption=f""" **#⃣ Lagu Di Antrian Ke {pos} šŸ·ļø Judul: [{songname}]({link}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) else: @@ -145,14 +133,14 @@ async def play(client, m: Message): ) add_to_queue(chat_id, songname, dl, link, "Audio", 0) await huehue.delete() - # await m.reply_to_message.delete() await m.reply_photo( photo="https://telegra.ph/file/6213d2673486beca02967.png", caption=f""" **ā–¶ Mulai Memutar Lagu šŸ·ļø Judul: [{songname}]({link}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) @@ -171,19 +159,20 @@ async def play(client, m: Message): url = search[1] hm, ytlink = await ytdl(url) if hm == 0: - await huehue.edit(f"**YTDL ERROR āš ļø** \n\n`{ytlink}`") + await huehue.edit(f"**YTDL ERROR** \n\n`{ytlink}`") else: if chat_id in QUEUE: pos = add_to_queue(chat_id, songname, ytlink, url, "Audio", 0) await huehue.delete() - # await m.reply_to_message.delete() - await m.reply_photo( - photo=f"{IMAGE_THUMBNAIL}", + await client.send_photo( + chat_id, + photo=f"{image_thumbnail}", caption=f""" **#⃣ Lagu Di Antrian Ke {pos} šŸ·ļø Judul: [{songname}]({url}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) else: @@ -197,18 +186,19 @@ async def play(client, m: Message): ) add_to_queue(chat_id, songname, ytlink, url, "Audio", 0) await huehue.delete() - # await m.reply_to_message.delete() - await m.reply_photo( - photo=f"{IMAGE_THUMBNAIL}", + await client.send_photo( + chat_id, + photo=f"{image_thumbnail}", caption=f""" **ā–¶ Mulai Memutar Lagu šŸ·ļø Judul: [{songname}]({url}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) except Exception as ep: - await huehue.edit(f"`{ep}`") + await m.reply(f"`{ep}`") @Client.on_message(filters.command(["vplay"], prefixes=f"{HNDLR}")) @@ -242,14 +232,15 @@ async def vplay(client, m: Message): if chat_id in QUEUE: pos = add_to_queue(chat_id, songname, dl, link, "Video", Q) await huehue.delete() - # await m.reply_to_message.delete() await m.reply_photo( + chat_id, photo="https://telegra.ph/file/d6f92c979ad96b2031cba.png", caption=f""" **#⃣ Video Di Antrian Ke {pos} šŸ·ļø Judul: [{songname}]({link}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) else: @@ -266,14 +257,14 @@ async def vplay(client, m: Message): ) add_to_queue(chat_id, songname, dl, link, "Video", Q) await huehue.delete() - # await m.reply_to_message.delete() await m.reply_photo( photo="https://telegra.ph/file/6213d2673486beca02967.png", caption=f""" **ā–¶ Mulai Memutar Video šŸ·ļø Judul: [{songname}]({link}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas permintaan: {m.from_user.mention}** +šŸŽ§ Atas permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) @@ -298,19 +289,20 @@ async def vplay(client, m: Message): url = search[1] hm, ytlink = await ytdl(url) if hm == 0: - await huehue.edit(f"**YTDL ERROR āš ļø** \n\n`{ytlink}`") + await huehue.edit(f"**YTDL ERROR** \n\n`{ytlink}`") else: if chat_id in QUEUE: pos = add_to_queue(chat_id, songname, ytlink, url, "Video", Q) await huehue.delete() - # await m.reply_to_message.delete() - await m.reply_photo( - photo=f"{IMAGE_THUMBNAIL}", + await client.send_photo( + chat_id, + photo=f"{image_thumbnail}", caption=f""" **#⃣ Video Di Antrian Ke {pos} šŸ·ļø Judul: [{songname}]({url}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) else: @@ -322,18 +314,19 @@ async def vplay(client, m: Message): ) add_to_queue(chat_id, songname, ytlink, url, "Video", Q) await huehue.delete() - # await m.reply_to_message.delete() - await m.reply_photo( - photo=f"{IMAGE_THUMBNAIL}", + await client.send_photo( + chat_id, + photo=f"{image_thumbnail}", caption=f""" **ā–¶ Mulai Memutar Video šŸ·ļø Judul: [{songname}]({url}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) except Exception as ep: - await huehue.edit(f"`{ep}`") + await m.reply(f" **ERROR**\n`{ep}`") @Client.on_message(filters.command(["playfrom"], prefixes=f"{HNDLR}")) @@ -371,22 +364,22 @@ async def playfrom(client, m: Message): stream_type=StreamType().pulse_stream, ) add_to_queue(chat_id, songname, location, link, "Audio", 0) - # await m.reply_to_message.delete() + await hmm.delete() await m.reply_photo( photo="https://telegra.ph/file/6213d2673486beca02967.png", caption=f""" **ā–¶ Mulai Memutar Lagu Dari {chat} šŸ·ļø Judul: [{songname}]({link}) šŸ’¬ Chat ID: {chat_id} -šŸŽ§ Atas Permintaan: {m.from_user.mention}** +šŸŽ§ Atas Permintaan: {m.from_user.mention} +====>[š—¦š—Øš—£š—£š—¢š—„š—§ š—–š—›š—”š—§](https://t.me/GroupMusicRandom)<====** """, ) - await hmm.delete() await m.reply( - f"āž• Menambahkan {lmt} Lagu Ke Dalam Antrian\n• Klik {HNDLR}playlist Untuk Melihat Daftar Putar**" + f"āž• Menambahkan {lmt} Lagu Ke Dalam Antrian\n• Ketik {HNDLR}playlist Untuk Melihat Daftar Putar**" ) except Exception as e: - await hmm.edit(f"**ERROR** \n`{e}`") + await m.reply(f"**ERROR** \n`{e}`") @Client.on_message(filters.command(["playlist", "queue"], prefixes=f"{HNDLR}")) diff --git a/MusicAndVideo/song.py b/MusicAndVideo/song.py index be835b6..1dc7b52 100644 --- a/MusicAndVideo/song.py +++ b/MusicAndVideo/song.py @@ -19,6 +19,7 @@ @Client.on_message(filters.command(["song", "music"], prefixes=f"{HNDLR}")) async def song(client, message: Message): + await message.delete() urlissed = get_text(message) if not urlissed: await client.send_message( @@ -233,8 +234,8 @@ def time_to_seconds(time): @Client.on_message(filters.command(["vsong", "video"], prefixes=f"{HNDLR}")) async def vsong(client, message: Message): + await message.delete() urlissed = get_text(message) - pablo = await client.send_message(message.chat.id, f"**šŸ”Ž Mencari** `{urlissed}`") if not urlissed: await pablo.edit( diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_1.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_1.jpg new file mode 100644 index 0000000..e941c83 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_1.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_10.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_10.jpg new file mode 100644 index 0000000..1bb779c Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_10.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_11.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_11.jpg new file mode 100644 index 0000000..b633832 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_11.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_12.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_12.jpg new file mode 100644 index 0000000..38e5314 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_12.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_2.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_2.jpg new file mode 100644 index 0000000..5af5f05 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_2.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_3.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_3.jpg new file mode 100644 index 0000000..eb61592 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_3.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_4.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_4.jpg new file mode 100644 index 0000000..d00aef2 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_4.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_5.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_5.jpg new file mode 100644 index 0000000..15e63fa Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_5.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_6.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_6.jpg new file mode 100644 index 0000000..1b9ba6b Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_6.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_7.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_7.jpg new file mode 100644 index 0000000..a1c1f26 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_7.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_8.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_8.jpg new file mode 100644 index 0000000..34c83a1 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_8.jpg differ diff --git a/MusicAndVideo/thumbnail/MusicAndVideo_9.jpg b/MusicAndVideo/thumbnail/MusicAndVideo_9.jpg new file mode 100644 index 0000000..74b3183 Binary files /dev/null and b/MusicAndVideo/thumbnail/MusicAndVideo_9.jpg differ diff --git a/MusicAndVideo/userbot.py b/MusicAndVideo/userbot.py index cc5dd65..ff3eb59 100644 --- a/MusicAndVideo/userbot.py +++ b/MusicAndVideo/userbot.py @@ -32,14 +32,23 @@ async def _human_time_duration(seconds): @Client.on_message(filters.command(["ping"], prefixes=f"{HNDLR}")) async def ping(client, m: Message): + await m.delete() start = time() current_time = datetime.utcnow() - m_reply = await m.reply_text("⚔") + m_reply = await m.reply_text("Ping.") + await m_reply.edit("Ping..") + await m_reply.edit("Ping...") + await m_reply.edit("Ping....") + await m_reply.edit("Ping.....") + await m_reply.edit("Ping......") + await m_reply.edit("Ping.......") + await m_reply.edit("Ping........") + await m_reply.edit("Ping.........") delta_ping = time() - start uptime_sec = (current_time - START_TIME).total_seconds() uptime = await _human_time_duration(int(uptime_sec)) await m_reply.edit( - f"šŸ“ PONG `{delta_ping * 1000:.3f} ms` \nā³ AKTIF - `{uptime}`" + f"šŸ“ PONG: `{delta_ping * 1000:.3f} ms` \nā³ AKTIF: `{uptime}`" ) @@ -47,6 +56,7 @@ async def ping(client, m: Message): filters.user(SUDO_USERS) & filters.command(["restart"], prefixes=f"{HNDLR}") ) async def restart(client, m: Message): + await m.delete() loli = await m.reply("1") await loli.edit("2") await loli.edit("3") @@ -63,8 +73,11 @@ async def restart(client, m: Message): @Client.on_message(filters.command(["help"], prefixes=f"{HNDLR}")) async def help(client, m: Message): + await m.delete() HELP = f""" -šŸ›  MENU BANTUAN +šŸ‘‹ HALLO {m.from_user.mention}! + +šŸ›  MENU BANTUAN ⚔ PERINTAH UNTUK SEMUA ORANG • {HNDLR}play [judul lagu | link youtube | balas file audio] - untuk memutar lagu @@ -84,8 +97,11 @@ async def help(client, m: Message): @Client.on_message(filters.command(["repo"], prefixes=f"{HNDLR}")) async def repo(client, m: Message): + await m.delete() REPO = f""" -šŸŽ¶ Music Dan Video Player UserBot +šŸ‘‹ HALLO {m.from_user.mention}! + +šŸŽ¶ Music Dan Video Player UserBot šŸ¤– Telegram UserBot Untuk Memutar Lagu Dan Video Di Obrolan Suara Telegram. diff --git a/config.py b/config.py index 9c9d92e..aecbdd4 100644 --- a/config.py +++ b/config.py @@ -1,7 +1,7 @@ import os from dotenv import load_dotenv -from pyrogram import Client, filters +from pyrogram import Client from pytgcalls import PyTgCalls # For Local Deploy @@ -15,11 +15,6 @@ HNDLR = os.getenv("HNDLR", "/") SUDO_USERS = list(map(int, os.getenv("SUDO_USERS").split())) - -contact_filter = filters.create( - lambda _, __, message: (message.from_user and message.from_user.is_contact) - or message.outgoing -) - +# Cellmusic bot = Client(SESSION, API_ID, API_HASH, plugins=dict(root="MusicAndVideo")) call_py = PyTgCalls(bot) diff --git a/main.py b/main.py index b7e8e82..eb8f54a 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,3 @@ -import asyncio - from pytgcalls import idle from config import call_py @@ -17,7 +15,3 @@ async def main(): ) await idle() await arq.close() - - -loop = asyncio.get_event_loop() -loop.run_until_complete(main()) diff --git a/requirements.txt b/requirements.txt index f0f785f..114715c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,13 +3,14 @@ git+https://github.com/pyrogram/pyrogram@master py-tgcalls==0.8.1rc1 requests aiohttp +Pillow aiofiles asyncio wget python-arq -youtube-search-python==1.4.6 youtube-search-python yt-dlp python-dotenv gTTS +emoji googletrans==4.0.0rc1