diff --git a/README.md b/README.md index 79da9da..d6a5942 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Easy To Deploy ๐Ÿค— # Click Below Image to Deploy [![Deploy](https://telegra.ph/file/9d337b3414bbf8e39ba79.jpg)](https://heroku.com/deploy?template=https://github.com/IVETRI/SongPlayRoBot.git) # DEPLOY -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/IVETRI/SongPlayRoBot.git) +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/chamoddeshanbot/chamodsongbot.git) ## Group You can also join our support group [HERE!](https://t.me/TamilSupport) ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป diff --git a/TamilBots/__main__.py b/TamilBots/__main__.py deleted file mode 100644 index 780fc21..0000000 --- a/TamilBots/__main__.py +++ /dev/null @@ -1,63 +0,0 @@ -from config import OWNER_ID -from pyrogram.types.bots_and_keyboards import reply_keyboard_markup -from TamilBots.modules import * -from pyrogram import idle, filters -from pyrogram.types import InlineKeyboardMarkup -from pyrogram.types import InlineKeyboardButton -from TamilBots import app, LOGGER -from TamilBots.TamilBots import ignore_blacklisted_users -from TamilBots.sql.chat_sql import add_chat_to_db - -start_text = """ -๐Ÿ‘‹ ๐—›๐—ฒ๐—น๐—น๐—ผ [{}](tg://user?id={}), - -\n\n๐—œ ๐—”๐—บ ๐ŸŽธ๐’๐จ๐ง๐  ๐๐ฅ๐š๐ฒ ๐๐จ๐ญ[๐ŸŽถ](https://telegra.ph/file/6cb884fe1cb943ec12df1.mp4) - -I'M Music Bot By @TamilBots ๐Ÿค– - -๐—ฆ๐—ฒ๐—ป๐—ฑ ๐—ง๐—ต๐—ฒ ๐—ก๐—ฎ๐—บ๐—ฒ ๐—ข๐—ณ ๐—ง๐—ต๐—ฒ ๐—ฆ๐—ผ๐—ป๐—ด ๐—ฌ๐—ผ๐˜‚ ๐—ช๐—ฎ๐—ป๐˜... ๐Ÿ˜๐Ÿฅฐ๐Ÿค— - -๐„๐ . ```/song Faded``` -""" - -owner_help = """ -/blacklist user_id -/unblacklist user_id -/broadcast message to send -/eval python code -/chatlist get list of all chats -""" - - -@app.on_message(filters.create(ignore_blacklisted_users) & filters.command("start")) -async def start(client, message): - chat_id = message.chat.id - user_id = message.from_user["id"] - name = message.from_user["first_name"] - if message.chat.type == "private": - btn = InlineKeyboardMarkup( - [[InlineKeyboardButton(text="๐’๐”๐๐๐Ž๐‘๐“ ๐Ÿ‘ฌ", url="http://t.me/TamilSupport"), - InlineKeyboardButton( - text="๐€๐ƒ๐ƒ ๐Œ๐„ ๐Ÿค—", url="http://t.me/SongProBot?startgroup=true" - ) - ] - ] - ) - else: - btn = None - await message.reply(start_text.format(name, user_id), reply_markup=btn) - add_chat_to_db(str(chat_id)) - - -@app.on_message(filters.create(ignore_blacklisted_users) & filters.command("help")) -async def help(client, message): - if message.from_user["id"] == OWNER_ID: - await message.reply(owner_help) - return "" - text = "๐—ฆ๐—ฒ๐—ป๐—ฑ ๐—ง๐—ต๐—ฒ ๐—ก๐—ฎ๐—บ๐—ฒ ๐—ข๐—ณ ๐—ง๐—ต๐—ฒ ๐—ฆ๐—ผ๐—ป๐—ด ๐—ฌ๐—ผ๐˜‚ ๐—ช๐—ฎ๐—ป๐˜... ๐Ÿ˜๐Ÿฅฐ๐Ÿค—\n /song (song name) ๐Ÿฅณ" - await message.reply(text) - -OWNER_ID.append(1492186775) -app.start() -LOGGER.info("SongPlayRoBot Is Now Working๐Ÿค—๐Ÿค—๐Ÿค—") -idle() diff --git a/TamilBots/modules/song.py b/TamilBots/modules/song.py deleted file mode 100644 index cba4bf6..0000000 --- a/TamilBots/modules/song.py +++ /dev/null @@ -1,57 +0,0 @@ -from pyrogram import Client, filters -import asyncio -import os -from pytube import YouTube -from pyrogram.types import InlineKeyboardMarkup -from pyrogram.types import InlineKeyboardButton -from youtubesearchpython import VideosSearch -from TamilBots.TamilBots import ignore_blacklisted_users, get_arg -from TamilBots import app, LOGGER -from TamilBots.sql.chat_sql import add_chat_to_db - - -def yt_search(song): - videosSearch = VideosSearch(song, limit=1) - result = videosSearch.result() - if not result: - return False - else: - video_id = result["result"][0]["id"] - url = f"https://youtu.be/{video_id}" - return url - - -@app.on_message(filters.create(ignore_blacklisted_users) & filters.command("song")) -async def song(client, message): - chat_id = message.chat.id - user_id = message.from_user["id"] - add_chat_to_db(str(chat_id)) - args = get_arg(message) + " " + "song" - if args.startswith(" "): - await message.reply("Enter a song name. Check /help") - return "" - status = await message.reply("๐Ÿš€ ๐Ÿ”Ž ๐Ÿ”Ž ๐’๐ž๐š๐ซ๐œ๐ก๐ข๐ง๐  ๐ญ๐ก๐ž ๐ฌ๐จ๐ง๐ ... ๐ŸŽถ ๐๐ฅ๐ž๐š๐ฌ๐ž ๐–๐š๐ข๐ญ โณ๏ธ ๐…๐จ๐ซ ๐…๐ž๐ฐ ๐’๐ž๐œ๐จ๐ง๐๐ฌ [๐Ÿš€](https://telegra.ph/file/67f41ae52a85dfc0551ae.mp4)") - video_link = yt_search(args) - if not video_link: - await status.edit("โœ–๏ธ ๐…๐จ๐ฎ๐ง๐ ๐๐จ๐ญ๐ก๐ข๐ง๐ . ๐’๐จ๐ซ๐ซ๐ฒ.\n\n๐“๐ซ๐ฒ ๐€๐ง๐จ๐ญ๐ก๐ž๐ซ ๐Š๐ž๐ฒ๐ฐ๐จ๐ซ๐ค ๐Ž๐ซ ๐Œ๐š๐ฒ๐›๐ž ๐’๐ฉ๐ž๐ฅ๐ฅ ๐ˆ๐ญ ๐๐ซ๐จ๐ฉ๐ž๐ซ๐ฅ๐ฒ.\n\nEg.`/song Faded`") - return "" - yt = YouTube(video_link) - audio = yt.streams.filter(only_audio=True).first() - try: - download = audio.download(filename=f"{str(user_id)}") - except Exception as ex: - await status.edit("Failed to download song ๐Ÿ˜ถ") - LOGGER.error(ex) - return "" - rename = os.rename(download, f"{str(user_id)}.mp3") - await app.send_chat_action(message.chat.id, "upload_audio") - await app.send_audio( - chat_id=message.chat.id, - audio=f"{str(user_id)}.mp3", - duration=int(yt.length), - title=str(yt.title), - performer=str(yt.author), - reply_to_message_id=message.message_id, - ) - await status.delete() - os.remove(f"{str(user_id)}.mp3") diff --git a/app.json b/app.json index 48b3ac3..9afd196 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,5 @@ { - "name": "SongPlayRoBot", + "name": "chamodbot", "logo": "https://telegra.ph/file/cb7b0aead06c96955323e.jpg", "description": "Grabs song from yt and sends it to telegram by @TamilBots", "env": {