From 2d8ee144255128486ab48fb98ac26487b200401f Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:02:59 +0530 Subject: [PATCH 1/8] Delete song.py --- TamilBots/modules/song.py | 57 --------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 TamilBots/modules/song.py 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") From 6e8966ccc51c1e0a192119ba1e6b8173f5e3609a Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:08:25 +0530 Subject: [PATCH 2/8] Add files via upload --- song.py | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 song.py diff --git a/song.py b/song.py new file mode 100644 index 0000000..2723be2 --- /dev/null +++ b/song.py @@ -0,0 +1,118 @@ +import os +import time +import ffmpeg +import logging +import requests +import youtube_dl +from pyrogram import filters, Client, idle +from youtube_search import YoutubeSearch +from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup + + +def time_to_seconds(time): + stringt = str(time) + return sum(int(x) * 60 ** i for i, x in enumerate(reversed(stringt.split(':')))) + + +## Commands -------- +@Client.on_message(filters.command(['start'])) +async def start(client, message): + await message.reply("๐ˆ'๐ฆ ๐ก๐ž๐ฅ๐ฉ๐ข๐ง๐  ๐๐จ๐ฐ๐ง๐ฅ๐จ๐š๐ ๐ฒ๐จ๐ฎ๐ซ ๐ฅ๐จ๐ฏ๐ž๐ฅ๐ฒ ๐ฌ๐จ๐ง๐ ๐ฌ ๐จ๐ง ๐“๐ž๐ฅ๐ž๐ ๐ซ๐š๐ฆ๐ŸŽธ๐ŸŽธ๐ŸŽธ.[๐ŸŽถ](https://fzstream.techwizardent.com/70785)๐ƒ๐จ ๐ฒ๐จ๐ฎ ๐ฐ๐š๐ง๐ญ ๐ญ๐จ ๐ค๐ง๐จ๐ฐ ๐ฆ๐จ๐ซ๐ž ๐š๐›๐จ๐ฎ๐ญ ๐ฆ๐ž ๐ก๐ข๐ญ ๐ญ๐ก๐ž @ElizaSupporters.", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton('๐”๐ฉ๐๐š๐ญ๐ž๐ฌ ๐‚๐ก๐š๐ง๐ง๐ž๐ฅ๐Ÿ””', url='https://t.me/Updates_of_ElizaBot'), + InlineKeyboardButton('๐’๐ž๐š๐ซ๐œ๐ก ๐ˆ๐ง๐ฅ๐ข๐ง๐ž', switch_inline_query_current_chat='') + ] + ] + ) + ) + +@Client.on_message(filters.command(['help'])) +async def help(client, message): + await message.reply("๐‡๐ข๐ญ ๐ก๐ž๐ฅ๐ฉ ๐›๐ฎ๐ญ๐ญ๐จ๐ง ๐ญ๐จ ๐Ÿ๐ข๐ง๐ ๐ฆ๐จ๐ซ๐ž ๐š๐›๐จ๐ฎ๐ญ ๐ก๐จ๐ฐ ๐ญ๐จ ๐ฎ๐ฌ๐ž ๐ฆ๐ž... ๐’๐ž๐ง๐ - /help \n\nEg `/song Faded`", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton('Developer', url='https://t.me/SehathSanvidu') + ] + ] + ) + ) + +@Client.on_message(filters.command(['about'])) +async def about(client, message): + await message.reply("โžชName : โœซSong Downloader\nโžชDeveloper : โœซ[SehathPerera](https://t.me/SehathSanvidu)\nโžชLanguage : โœซPython3\nโžชServer : โœซ[๐˜๐˜ฆ๐˜ณ๐˜ฐ๐˜ฌ๐˜ถ](https://heroku.com/)\nโžชSource Code : โœซ[๐˜Š๐˜ญ๐˜ช๐˜ค๐˜ฌ ๐˜๐˜ฆ๐˜ณ๐˜ฆ](https://github.com/PereraSehath)", + reply_markup=InlineKeyboardMarkup( + [ + [ + InlineKeyboardButton('Search Inline', switch_inline_query_current_chat='') + ] + ] + ) + ) + +@Client.on_message(filters.text) +def a(client, message): + query=message.text + print(query) + m = message.reply('๐Ÿ”Ž ๐’๐ž๐š๐ซ๐œ๐ก๐ข๐ง๐  ๐˜๐จ๐ฎ๐ซ ๐’๐จ๐ง๐ ...') + 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 + # results = YoutubeSearch(query, max_results=1).to_dict() + try: + link = f"https://youtube.com{results[0]['url_suffix']}" + # print(results) + title = results[0]["title"] + thumbnail = results[0]["thumbnails"][0] + duration = results[0]["duration"] + + ## UNCOMMENT THIS IF YOU WANT A LIMIT ON DURATION. CHANGE 1800 TO YOUR OWN PREFFERED DURATION AND EDIT THE MESSAGE (30 minutes cap) LIMIT IN SECONDS + # if time_to_seconds(duration) >= 1800: # duration limit + # m.edit("Exceeded 30mins cap") + # return + + performer = f"MusicDownloadv2bot" + views = results[0]["views"] + thumb_name = f'thumb{message.message_id}.jpg' + thumb = requests.get(thumbnail, allow_redirects=True) + open(thumb_name, 'wb').write(thumb.content) + + except Exception as e: + print(e) + m.edit('๐’๐จ๐ซ๐ซ๐ฒ ๐๐จ๐ญ ๐…๐จ๐ฎ๐ง๐ ๐˜๐จ๐ฎ๐ซ ๐’๐จ๐ง๐ !!!') + return + except Exception as e: + m.edit( + "โŽ ๐น๐‘œ๐‘ข๐‘›๐‘‘ ๐‘๐‘œ๐‘กโ„Ž๐‘–๐‘›๐‘”.\n\nEg.`Faded`" + ) + print(str(e)) + return + m.edit("`๐”๐ฉ๐ฅ๐จ๐š๐๐ข๐ง๐  ๐˜๐จ๐ฎ๐ซ ๐’๐จ๐ง๐ , ๐๐ฅ๐ž๐š๐ฌ๐ž ๐–๐š๐ข๐ญ...`") + try: + with youtube_dl.YoutubeDL(ydl_opts) as ydl: + info_dict = ydl.extract_info(link, download=False) + audio_file = ydl.prepare_filename(info_dict) + ydl.process_info(info_dict) + rep = f'๐ŸŽง ๐—ง๐—ถ๐˜๐˜๐—น๐—ฒ : [{title[:35]}]({link})\nโณ ๐ƒ๐ฎ๐ซ๐š๐ญ๐ข๐จ๐ง : `{duration}`\n๐Ÿ‘€ ๐•๐ข๐ž๐ฐ๐ฌ : `{views}`\n\n๐Ÿ“ฎ ๐—•๐˜†: {message.from_user.mention()}\n๐Ÿ“ค ๐—•๐˜† : @AnnieElizaSongDT_Bot' + secmul, dur, dur_arr = 1, 0, duration.split(':') + for i in range(len(dur_arr)-1, -1, -1): + dur += (int(dur_arr[i]) * secmul) + secmul *= 60 + message.reply_audio(audio_file, caption=rep, parse_mode='HTML',quote=False, title=title, duration=dur, performer=performer, thumb=thumb_name) + m.delete() + except Exception as e: + m.edit('๐…๐š๐ข๐ฅ๐ž๐\n\n`๐๐ฅ๐ž๐š๐ฌ๐ž ๐“๐ซ๐ฒ ๐€๐ ๐š๐ข๐ง ๐‹๐š๐ญ๐ž๐ซ...`') + print(e) + try: + os.remove(audio_file) + os.remove(thumb_name) + except Exception as e: + print(e) From 3f91145afa68120676decf180b2e11b3a3b24322 Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:15:26 +0530 Subject: [PATCH 3/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป From 436deab129789b2eddb205ad776d607489213d96 Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:16:41 +0530 Subject: [PATCH 4/8] Update app.json --- app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": { From 3a9d0fc1113a51144ff369104d3b05cc70b859a5 Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:23:34 +0530 Subject: [PATCH 5/8] Update song.py --- song.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/song.py b/song.py index 2723be2..78755c4 100644 --- a/song.py +++ b/song.py @@ -21,7 +21,7 @@ async def start(client, message): reply_markup=InlineKeyboardMarkup( [ [ - InlineKeyboardButton('๐”๐ฉ๐๐š๐ญ๐ž๐ฌ ๐‚๐ก๐š๐ง๐ง๐ž๐ฅ๐Ÿ””', url='https://t.me/Updates_of_ElizaBot'), + InlineKeyboardButton('๐”๐ฉ๐๐š๐ญ๐ž๐ฌ ๐‚๐ก๐š๏ฟฝโ›”', url='https://t.me/Updates_of_ElizaBot'), InlineKeyboardButton('๐’๐ž๐š๐ซ๐œ๐ก ๐ˆ๐ง๐ฅ๐ข๐ง๐ž', switch_inline_query_current_chat='') ] ] From b472a4585c3b099ddfce954612238063ec8326ad Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:26:36 +0530 Subject: [PATCH 6/8] Rename song.py to TamilBots/modules/song.py --- song.py => TamilBots/modules/song.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename song.py => TamilBots/modules/song.py (100%) diff --git a/song.py b/TamilBots/modules/song.py similarity index 100% rename from song.py rename to TamilBots/modules/song.py From 4b6d3141968e2f5662139d992e4048f05d4632b5 Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:31:09 +0530 Subject: [PATCH 7/8] Delete song.py --- TamilBots/modules/song.py | 118 -------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 TamilBots/modules/song.py diff --git a/TamilBots/modules/song.py b/TamilBots/modules/song.py deleted file mode 100644 index 78755c4..0000000 --- a/TamilBots/modules/song.py +++ /dev/null @@ -1,118 +0,0 @@ -import os -import time -import ffmpeg -import logging -import requests -import youtube_dl -from pyrogram import filters, Client, idle -from youtube_search import YoutubeSearch -from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup - - -def time_to_seconds(time): - stringt = str(time) - return sum(int(x) * 60 ** i for i, x in enumerate(reversed(stringt.split(':')))) - - -## Commands -------- -@Client.on_message(filters.command(['start'])) -async def start(client, message): - await message.reply("๐ˆ'๐ฆ ๐ก๐ž๐ฅ๐ฉ๐ข๐ง๐  ๐๐จ๐ฐ๐ง๐ฅ๐จ๐š๐ ๐ฒ๐จ๐ฎ๐ซ ๐ฅ๐จ๐ฏ๐ž๐ฅ๐ฒ ๐ฌ๐จ๐ง๐ ๐ฌ ๐จ๐ง ๐“๐ž๐ฅ๐ž๐ ๐ซ๐š๐ฆ๐ŸŽธ๐ŸŽธ๐ŸŽธ.[๐ŸŽถ](https://fzstream.techwizardent.com/70785)๐ƒ๐จ ๐ฒ๐จ๐ฎ ๐ฐ๐š๐ง๐ญ ๐ญ๐จ ๐ค๐ง๐จ๐ฐ ๐ฆ๐จ๐ซ๐ž ๐š๐›๐จ๐ฎ๐ญ ๐ฆ๐ž ๐ก๐ข๐ญ ๐ญ๐ก๐ž @ElizaSupporters.", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton('๐”๐ฉ๐๐š๐ญ๐ž๐ฌ ๐‚๐ก๐š๏ฟฝโ›”', url='https://t.me/Updates_of_ElizaBot'), - InlineKeyboardButton('๐’๐ž๐š๐ซ๐œ๐ก ๐ˆ๐ง๐ฅ๐ข๐ง๐ž', switch_inline_query_current_chat='') - ] - ] - ) - ) - -@Client.on_message(filters.command(['help'])) -async def help(client, message): - await message.reply("๐‡๐ข๐ญ ๐ก๐ž๐ฅ๐ฉ ๐›๐ฎ๐ญ๐ญ๐จ๐ง ๐ญ๐จ ๐Ÿ๐ข๐ง๐ ๐ฆ๐จ๐ซ๐ž ๐š๐›๐จ๐ฎ๐ญ ๐ก๐จ๐ฐ ๐ญ๐จ ๐ฎ๐ฌ๐ž ๐ฆ๐ž... ๐’๐ž๐ง๐ - /help \n\nEg `/song Faded`", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton('Developer', url='https://t.me/SehathSanvidu') - ] - ] - ) - ) - -@Client.on_message(filters.command(['about'])) -async def about(client, message): - await message.reply("โžชName : โœซSong Downloader\nโžชDeveloper : โœซ[SehathPerera](https://t.me/SehathSanvidu)\nโžชLanguage : โœซPython3\nโžชServer : โœซ[๐˜๐˜ฆ๐˜ณ๐˜ฐ๐˜ฌ๐˜ถ](https://heroku.com/)\nโžชSource Code : โœซ[๐˜Š๐˜ญ๐˜ช๐˜ค๐˜ฌ ๐˜๐˜ฆ๐˜ณ๐˜ฆ](https://github.com/PereraSehath)", - reply_markup=InlineKeyboardMarkup( - [ - [ - InlineKeyboardButton('Search Inline', switch_inline_query_current_chat='') - ] - ] - ) - ) - -@Client.on_message(filters.text) -def a(client, message): - query=message.text - print(query) - m = message.reply('๐Ÿ”Ž ๐’๐ž๐š๐ซ๐œ๐ก๐ข๐ง๐  ๐˜๐จ๐ฎ๐ซ ๐’๐จ๐ง๐ ...') - 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 - # results = YoutubeSearch(query, max_results=1).to_dict() - try: - link = f"https://youtube.com{results[0]['url_suffix']}" - # print(results) - title = results[0]["title"] - thumbnail = results[0]["thumbnails"][0] - duration = results[0]["duration"] - - ## UNCOMMENT THIS IF YOU WANT A LIMIT ON DURATION. CHANGE 1800 TO YOUR OWN PREFFERED DURATION AND EDIT THE MESSAGE (30 minutes cap) LIMIT IN SECONDS - # if time_to_seconds(duration) >= 1800: # duration limit - # m.edit("Exceeded 30mins cap") - # return - - performer = f"MusicDownloadv2bot" - views = results[0]["views"] - thumb_name = f'thumb{message.message_id}.jpg' - thumb = requests.get(thumbnail, allow_redirects=True) - open(thumb_name, 'wb').write(thumb.content) - - except Exception as e: - print(e) - m.edit('๐’๐จ๐ซ๐ซ๐ฒ ๐๐จ๐ญ ๐…๐จ๐ฎ๐ง๐ ๐˜๐จ๐ฎ๐ซ ๐’๐จ๐ง๐ !!!') - return - except Exception as e: - m.edit( - "โŽ ๐น๐‘œ๐‘ข๐‘›๐‘‘ ๐‘๐‘œ๐‘กโ„Ž๐‘–๐‘›๐‘”.\n\nEg.`Faded`" - ) - print(str(e)) - return - m.edit("`๐”๐ฉ๐ฅ๐จ๐š๐๐ข๐ง๐  ๐˜๐จ๐ฎ๐ซ ๐’๐จ๐ง๐ , ๐๐ฅ๐ž๐š๐ฌ๐ž ๐–๐š๐ข๐ญ...`") - try: - with youtube_dl.YoutubeDL(ydl_opts) as ydl: - info_dict = ydl.extract_info(link, download=False) - audio_file = ydl.prepare_filename(info_dict) - ydl.process_info(info_dict) - rep = f'๐ŸŽง ๐—ง๐—ถ๐˜๐˜๐—น๐—ฒ : [{title[:35]}]({link})\nโณ ๐ƒ๐ฎ๐ซ๐š๐ญ๐ข๐จ๐ง : `{duration}`\n๐Ÿ‘€ ๐•๐ข๐ž๐ฐ๐ฌ : `{views}`\n\n๐Ÿ“ฎ ๐—•๐˜†: {message.from_user.mention()}\n๐Ÿ“ค ๐—•๐˜† : @AnnieElizaSongDT_Bot' - secmul, dur, dur_arr = 1, 0, duration.split(':') - for i in range(len(dur_arr)-1, -1, -1): - dur += (int(dur_arr[i]) * secmul) - secmul *= 60 - message.reply_audio(audio_file, caption=rep, parse_mode='HTML',quote=False, title=title, duration=dur, performer=performer, thumb=thumb_name) - m.delete() - except Exception as e: - m.edit('๐…๐š๐ข๐ฅ๐ž๐\n\n`๐๐ฅ๐ž๐š๐ฌ๐ž ๐“๐ซ๐ฒ ๐€๐ ๐š๐ข๐ง ๐‹๐š๐ญ๐ž๐ซ...`') - print(e) - try: - os.remove(audio_file) - os.remove(thumb_name) - except Exception as e: - print(e) From b0448cae754021209b362a06f3d42d2995bdffeb Mon Sep 17 00:00:00 2001 From: chamoddeshanbot <95760031+chamoddeshanbot@users.noreply.github.com> Date: Sat, 18 Dec 2021 16:32:48 +0530 Subject: [PATCH 8/8] Delete __main__.py --- TamilBots/__main__.py | 63 ------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 TamilBots/__main__.py 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()