├── .buildpacks ├── .dockerignore ├── .github ├── CODEOWNERS ├── README.md ├── cover.png ├── dependabot.yml └── workflows │ └── black.yml ├── .gitignore ├── .python-version ├── .sourcery.yaml ├── AlexaMusic ├── __init__.py ├── __main__.py ├── core │ ├── bot.py │ ├── call.py │ ├── cookies.py │ ├── dir.py │ ├── git.py │ ├── mongo.py │ └── userbot.py ├── logging.py ├── misc.py ├── platforms │ ├── Apple.py │ ├── Carbon.py │ ├── Resso.py │ ├── Soundcloud.py │ ├── Spotify.py │ ├── Telegram.py │ ├── Youtube.py │ └── __init__.py ├── plugins │ ├── __init__.py │ ├── admins │ │ ├── auth.py │ │ ├── callback.py │ │ ├── loop.py │ │ ├── mute.py │ │ ├── pause.py │ │ ├── resume.py │ │ ├── seek.py │ │ ├── shuffle.py │ │ ├── skip.py │ │ ├── stop.py │ │ └── unmute.py │ ├── bot │ │ ├── help.py │ │ ├── inline.py │ │ ├── settings.py │ │ └── start.py │ ├── devs │ │ └── dev.py │ ├── misc │ │ ├── autoleave.py │ │ ├── seeker.py │ │ └── suggestion.py │ ├── modules │ │ ├── botwelcomlog.py │ │ ├── broadcast.py │ │ ├── id.py │ │ ├── paidsub.py │ │ └── punishment.py │ ├── play │ │ ├── channel.py │ │ ├── live.py │ │ ├── play.py │ │ ├── playlist.py │ │ ├── playmode.py │ │ ├── stream.py │ │ └── toptracks.py │ ├── sudo │ │ ├── autoend.py │ │ ├── blacklistchat.py │ │ ├── block.py │ │ ├── heroku.py │ │ ├── logger.py │ │ ├── maintenance.py │ │ ├── private.py │ │ ├── sudoers.py │ │ ├── vars.py │ │ ├── videolimit.py │ │ └── videomode.py │ └── tools │ │ ├── active.py │ │ ├── languages.py │ │ ├── lyrics.py │ │ ├── ping.py │ │ ├── queue.py │ │ ├── reload.py │ │ ├── songs.py │ │ ├── speedtest.py │ │ └── stats.py └── utils │ ├── __init__.py │ ├── channelplay.py │ ├── command.py │ ├── database │ ├── __init__.py │ ├── assistantdatabase.py │ ├── brtools.py │ ├── chats.py │ ├── gban.py │ ├── memorydatabase.py │ ├── mongodatabase.py │ ├── onoff.py │ ├── pmpermit.py │ ├── sudo.py │ └── theme.py │ ├── decorators │ ├── __init__.py │ ├── admins.py │ ├── language.py │ └── play.py │ ├── exceptions.py │ ├── formatters.py │ ├── inline │ ├── __init__.py │ ├── help.py │ ├── play.py │ ├── playlist.py │ ├── queue.py │ ├── settings.py │ ├── song.py │ ├── start.py │ └── stats.py │ ├── inlinequery.py │ ├── logger.py │ ├── pastebin.py │ ├── stream │ ├── autoclear.py │ ├── queue.py │ └── stream.py │ ├── sys.py │ ├── theme.py │ └── thumbnails.py ├── Backgrounds ├── Readme.md ├── alexa1.PNG ├── alexa2.PNG ├── alexa3.PNG ├── alexa4.PNG ├── alexa5.PNG ├── alexa6.PNG ├── alexa7.PNG └── alexa8.PNG ├── Dockerfile ├── LICENSE ├── Procfile ├── app.json ├── app.py ├── assets ├── Audio.jpeg ├── Global.jpeg ├── Ping.jpeg ├── Playlist.jpeg ├── Soundcloud.jpeg ├── SpotifyAlbum.jpeg ├── SpotifyArtist.jpeg ├── SpotifyPlaylist.jpeg ├── Stats.jpeg ├── Stream.jpeg ├── Video.jpeg ├── Youtube.jpeg ├── font.ttf ├── font2.ttf └── readme.md ├── config ├── __init__.py └── config.py ├── cookies ├── README.md └── cookies.txt ├── docker-compose.yml ├── genstring.py ├── heroku.yml ├── koyeb.yaml ├── render.yaml ├── requirements.txt ├── sample.env ├── start └── strings ├── __init__.py ├── command.yml ├── helpers.py └── langs ├── az.yml ├── cheems.yml ├── en.yml ├── gu.yml ├── hi.yml ├── si.yml └── tr.yml /.buildpacks: -------------------------------------------------------------------------------- 1 | https://github.com/Scalingo/python-buildpack 2 | https://github.com/Scalingo/nodejs-buildpack 3 | https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .env 2 | .cache 3 | Logs.txt 4 | .DS_Store 5 | *.session 6 | raw_files/ 7 | cache/ 8 | downloads/ 9 | __pycache__/ 10 | *.session-journal -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @TheTeamAlexa -------------------------------------------------------------------------------- /.github/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/.github/cover.png -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: pip 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "00:00" 8 | timezone: "Asia/Kolkata" 9 | labels: 10 | - "dependencies" 11 | open-pull-requests-limit: 50 12 | -------------------------------------------------------------------------------- /.github/workflows/black.yml: -------------------------------------------------------------------------------- 1 | name: Black 2 | 3 | on: push 4 | 5 | jobs: 6 | black: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - uses: actions/setup-python@v2 11 | - name: Install black 12 | run: | 13 | python -m pip install --upgrade pip 14 | python -m pip install -U black 15 | - name: Run black 16 | run: black . 17 | - name: Create Pull Request 18 | uses: peter-evans/create-pull-request@v3 19 | with: 20 | commit-message: Formate By @TheTeamAlexa 21 | title: Format code. 22 | body: Automated code formatting. 23 | labels: ⚫️ black 24 | branch: autofix 25 | committer: TheTeamAlexa 26 | author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> 27 | signoff: true 28 | delete-branch: true 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | .cache 3 | logs.txt 4 | .DS_Store 5 | *.session 6 | raw_files/ 7 | cache/ 8 | downloads/ 9 | __pycache__/ 10 | *.session-journal -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.12.9 2 | -------------------------------------------------------------------------------- /.sourcery.yaml: -------------------------------------------------------------------------------- 1 | version: '1' # The schema version of this config file 2 | 3 | ignore: # A list of paths or files which Sourcery will ignore. 4 | - .git 5 | - assets 6 | - cookies 7 | 8 | rule_settings: 9 | enable: 10 | - default 11 | disable: [] # A list of rule IDs Sourcery will never suggest. 12 | rule_types: 13 | - refactoring 14 | - suggestion 15 | - comment 16 | python_version: '3.12' # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version. 17 | -------------------------------------------------------------------------------- /AlexaMusic/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from AlexaMusic.core.bot import AlexaBot 14 | from AlexaMusic.core.dir import dirr 15 | from AlexaMusic.core.git import git 16 | from AlexaMusic.core.userbot import Userbot 17 | from AlexaMusic.misc import dbb, heroku 18 | 19 | from .logging import LOGGER 20 | 21 | # Directories 22 | dirr() 23 | 24 | # Check Git Updates 25 | git() 26 | 27 | # Initialize Memory DB 28 | dbb() 29 | 30 | # Heroku APP 31 | heroku() 32 | 33 | # Bot Client 34 | app = AlexaBot() 35 | 36 | # Assistant Client 37 | userbot = Userbot() 38 | 39 | from .platforms import * 40 | 41 | YouTube = YouTubeAPI() 42 | Carbon = CarbonAPI() 43 | Spotify = SpotifyAPI() 44 | Apple = AppleAPI() 45 | Resso = RessoAPI() 46 | SoundCloud = SoundAPI() 47 | Telegram = TeleAPI() 48 | -------------------------------------------------------------------------------- /AlexaMusic/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | import importlib 15 | from typing import Any 16 | 17 | from pyrogram import idle 18 | from pytgcalls.exceptions import NoActiveGroupCall 19 | 20 | import config 21 | from config import BANNED_USERS 22 | from AlexaMusic import LOGGER, app, userbot 23 | from AlexaMusic.core.call import Alexa 24 | from AlexaMusic.misc import sudo 25 | from AlexaMusic.plugins import ALL_MODULES 26 | from AlexaMusic.utils.database import get_banned_users, get_gbanned 27 | from AlexaMusic.core.cookies import save_cookies 28 | 29 | 30 | async def init() -> None: 31 | # Check for at least one valid Pyrogram string session 32 | if all(not getattr(config, f"STRING{i}") for i in range(1, 6)): 33 | LOGGER("AlexaMusic").error("Add Pyrogram string session and then try...") 34 | exit() 35 | await sudo() 36 | try: 37 | for user_id in await get_gbanned(): 38 | BANNED_USERS.add(user_id) 39 | for user_id in await get_banned_users(): 40 | BANNED_USERS.add(user_id) 41 | except Exception: 42 | pass 43 | await app.start() 44 | await save_cookies() 45 | for module in ALL_MODULES: 46 | importlib.import_module(f"AlexaMusic.plugins{module}") 47 | LOGGER("AlexaMusic.plugins").info("Necessary Modules Imported Successfully.") 48 | await userbot.start() 49 | await Alexa.start() 50 | try: 51 | await Alexa.stream_call("https://telegra.ph/file/b60b80ccb06f7a48f68b5.mp4") 52 | except NoActiveGroupCall: 53 | LOGGER("AlexaMusic").error( 54 | "[ERROR] - \n\nTurn on group voice chat and don't put it off otherwise I'll stop working thanks." 55 | ) 56 | exit() 57 | except Exception: 58 | pass 59 | await Alexa.decorators() 60 | LOGGER("AlexaMusic").info("Alexa Music Bot Started Successfully") 61 | await idle() 62 | await app.stop() 63 | await userbot.stop() 64 | LOGGER("AlexaMusic").info("Stopping Alexa Music Bot...") 65 | 66 | 67 | if __name__ == "__main__": 68 | asyncio.get_event_loop().run_until_complete(init()) 69 | LOGGER("AlexaMusic").info("Stopping Music Bot") 70 | -------------------------------------------------------------------------------- /AlexaMusic/core/bot.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import sys 14 | 15 | from pyrogram import Client 16 | import config 17 | from ..logging import LOGGER 18 | from pyrogram.enums import ChatMemberStatus 19 | 20 | 21 | class AlexaBot(Client): 22 | def __init__(self): 23 | super().__init__( 24 | "MusicBot", 25 | api_id=config.API_ID, 26 | api_hash=config.API_HASH, 27 | bot_token=config.BOT_TOKEN, 28 | max_concurrent_transmissions=5, 29 | ) 30 | LOGGER(__name__).info("Starting Bot...") 31 | 32 | async def start(self): 33 | await super().start() 34 | get_me = await self.get_me() 35 | self.username = get_me.username 36 | self.id = get_me.id 37 | self.mention = get_me.mention 38 | try: 39 | await self.send_message( 40 | config.LOG_GROUP_ID, "» ᴍᴜsɪᴄ ʙᴏᴛ sᴛᴀʀᴛᴇᴅ, ᴡᴀɪᴛɪɴɢ ғᴏʀ ᴀssɪsᴛᴀɴᴛ..." 41 | ) 42 | except Exception: 43 | LOGGER(__name__).error( 44 | "Bot has failed to access the log Group. Make sure that you have added your bot to your log channel and promoted as admin!" 45 | ) 46 | sys.exit() 47 | a = await self.get_chat_member(config.LOG_GROUP_ID, self.id) 48 | if a.status != ChatMemberStatus.ADMINISTRATOR: 49 | LOGGER(__name__).error("Please promote Bot as Admin in Logger Group") 50 | sys.exit() 51 | if get_me.last_name: 52 | self.name = f"{get_me.first_name} {get_me.last_name}" 53 | else: 54 | self.name = get_me.first_name 55 | LOGGER(__name__).info(f"MusicBot Started as {self.name}") 56 | -------------------------------------------------------------------------------- /AlexaMusic/core/cookies.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 @KSKOP69. All rights reserved. 2 | # Use of this source code is governed by a proprietary license. 3 | 4 | # Made by @KSKOP69 with ❤️ 5 | 6 | 7 | import os 8 | import aiohttp 9 | import aiofiles 10 | import asyncio 11 | 12 | import config 13 | from ..logging import LOGGER 14 | 15 | 16 | async def fetch_content(session: aiohttp.ClientSession, url: str): 17 | try: 18 | async with session.get(url) as response: 19 | response.raise_for_status() 20 | return await response.text() 21 | except aiohttp.ClientError as e: 22 | LOGGER(__name__).error(f"Error fetching from {url}: {e}") 23 | return "" 24 | 25 | 26 | async def save_file(content: str, file_path: str): 27 | try: 28 | os.makedirs(os.path.dirname(file_path), exist_ok=True) 29 | async with aiofiles.open(file_path, "w") as file: 30 | await file.write(content) 31 | return file_path 32 | except Exception as e: 33 | LOGGER(__name__).error(f"Error saving file {file_path}: {e}") 34 | return "" 35 | 36 | 37 | async def save_cookies(): 38 | full_url: str = str(config.COOKIES) 39 | paste_id: str = full_url.split("/")[-1] 40 | pastebin_url: str = f"https://batbin.me/raw/{paste_id}" 41 | 42 | async with aiohttp.ClientSession() as session: 43 | content = await fetch_content(session, pastebin_url) 44 | 45 | if content: 46 | file_path = "cookies/cookies.txt" 47 | saved_path = await save_file(content, file_path) 48 | 49 | if saved_path and os.path.getsize(saved_path) > 0: 50 | LOGGER(__name__).info(f"Cookies saved successfully to {saved_path}.") 51 | else: 52 | LOGGER(__name__).error("Failed to save cookies or the file is empty.") 53 | else: 54 | LOGGER(__name__).error("Failed to fetch cookies.") 55 | -------------------------------------------------------------------------------- /AlexaMusic/core/dir.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from os import listdir, mkdir 14 | from os.path import isdir 15 | from shutil import rmtree 16 | 17 | from ..logging import LOGGER 18 | 19 | 20 | def dirr(): 21 | current_items = listdir() 22 | 23 | if "assets" not in current_items: 24 | LOGGER(__name__).warning( 25 | "Assets Folder not Found. Please clone repository again." 26 | ) 27 | exit() 28 | 29 | for folder in ("downloads", "cache"): 30 | if folder in current_items and isdir(folder): 31 | rmtree(folder) 32 | mkdir(folder) 33 | 34 | LOGGER(__name__).info("Directories Updated.") 35 | -------------------------------------------------------------------------------- /AlexaMusic/core/git.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | import shlex 15 | from typing import Tuple 16 | 17 | from git import Repo 18 | from git.exc import GitCommandError, InvalidGitRepositoryError 19 | 20 | import config 21 | 22 | from ..logging import LOGGER 23 | 24 | 25 | def install_req(cmd: str) -> Tuple[str, str, int, int]: 26 | async def install_requirements(): 27 | args = shlex.split(cmd) 28 | process = await asyncio.create_subprocess_exec( 29 | *args, 30 | stdout=asyncio.subprocess.PIPE, 31 | stderr=asyncio.subprocess.PIPE, 32 | ) 33 | stdout, stderr = await process.communicate() 34 | return ( 35 | stdout.decode("utf-8", "replace").strip(), 36 | stderr.decode("utf-8", "replace").strip(), 37 | process.returncode, 38 | process.pid, 39 | ) 40 | 41 | return asyncio.get_event_loop().run_until_complete(install_requirements()) 42 | 43 | 44 | def git(): 45 | REPO_LINK = config.UPSTREAM_REPO 46 | if config.GIT_TOKEN: 47 | GIT_USERNAME = REPO_LINK.split("com/")[1].split("/")[0] 48 | TEMP_REPO = REPO_LINK.split("https://")[1] 49 | UPSTREAM_REPO = f"https://{GIT_USERNAME}:{config.GIT_TOKEN}@{TEMP_REPO}" 50 | else: 51 | UPSTREAM_REPO = config.UPSTREAM_REPO 52 | try: 53 | repo = Repo() 54 | LOGGER(__name__).info("Git Client Found [VPS DEPLOYER]") 55 | except GitCommandError: 56 | LOGGER(__name__).info(f"Invalid Git Command") 57 | except InvalidGitRepositoryError: 58 | repo = Repo.init() 59 | if "origin" in repo.remotes: 60 | origin = repo.remote("origin") 61 | else: 62 | origin = repo.create_remote("origin", UPSTREAM_REPO) 63 | origin.fetch() 64 | repo.create_head( 65 | config.UPSTREAM_BRANCH, 66 | origin.refs[config.UPSTREAM_BRANCH], 67 | ) 68 | repo.heads[config.UPSTREAM_BRANCH].set_tracking_branch( 69 | origin.refs[config.UPSTREAM_BRANCH] 70 | ) 71 | repo.heads[config.UPSTREAM_BRANCH].checkout(True) 72 | try: 73 | repo.create_remote("origin", config.UPSTREAM_REPO) 74 | except BaseException: 75 | pass 76 | nrs = repo.remote("origin") 77 | nrs.fetch(config.UPSTREAM_BRANCH) 78 | try: 79 | nrs.pull(config.UPSTREAM_BRANCH) 80 | except GitCommandError: 81 | repo.git.reset("--hard", "FETCH_HEAD") 82 | install_req("pip3 install --no-cache-dir -r requirements.txt") 83 | LOGGER(__name__).info(f"Fetched Updates from: {REPO_LINK}") 84 | -------------------------------------------------------------------------------- /AlexaMusic/core/mongo.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from motor.motor_asyncio import AsyncIOMotorClient 14 | 15 | from config import MONGO_DB_URI 16 | 17 | from ..logging import LOGGER 18 | 19 | LOGGER(__name__).info("Connecting to your Mongo Database...") 20 | try: 21 | _mongo_async_ = AsyncIOMotorClient(MONGO_DB_URI) 22 | mongodb = _mongo_async_.Alexa 23 | LOGGER(__name__).info("Connected to your Mongo Database.") 24 | except Exception: 25 | LOGGER(__name__).error("Failed to connect to your Mongo Database.") 26 | exit() 27 | 28 | ## Database For Broadcast Subscription By Team Alexa 29 | MONGODB_CLI = AsyncIOMotorClient(MONGO_DB_URI) 30 | db = MONGODB_CLI["subscriptions"] 31 | -------------------------------------------------------------------------------- /AlexaMusic/logging.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import logging 13 | from logging.handlers import RotatingFileHandler 14 | 15 | from config import LOG_FILE_NAME 16 | 17 | logging.basicConfig( 18 | level=logging.INFO, 19 | format="[%(asctime)s - %(levelname)s] - %(name)s - %(message)s", 20 | datefmt="%d-%b-%y %H:%M:%S", 21 | handlers=[ 22 | RotatingFileHandler(LOG_FILE_NAME, maxBytes=5000000, backupCount=10), 23 | logging.StreamHandler(), 24 | ], 25 | ) 26 | 27 | logging.getLogger("pyrogram").setLevel(logging.ERROR) 28 | logging.getLogger("pytgcalls").setLevel(logging.WARNING) 29 | logging.getLogger("httpx").setLevel(logging.ERROR) 30 | logging.getLogger("ntgcalls").setLevel(logging.CRITICAL) 31 | 32 | 33 | def LOGGER(name: str) -> logging.Logger: 34 | return logging.getLogger(name) 35 | -------------------------------------------------------------------------------- /AlexaMusic/misc.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import socket 13 | import time 14 | 15 | import heroku3 16 | from pyrogram import filters 17 | 18 | import config 19 | from AlexaMusic.core.mongo import mongodb 20 | 21 | from .logging import LOGGER 22 | 23 | SUDOERS = filters.user() 24 | 25 | HAPP = None 26 | _boot_ = time.time() 27 | 28 | 29 | def is_heroku(): 30 | return "heroku" in socket.getfqdn() 31 | 32 | 33 | XCB = [ 34 | "/", 35 | "@", 36 | ".", 37 | "com", 38 | ":", 39 | "git", 40 | "heroku", 41 | "push", 42 | str(config.HEROKU_API_KEY), 43 | "https", 44 | str(config.HEROKU_APP_NAME), 45 | "HEAD", 46 | "master", 47 | ] 48 | 49 | 50 | def dbb(): 51 | global db 52 | db = {} 53 | LOGGER(__name__).info("Database Initialized.") 54 | 55 | 56 | async def sudo(): 57 | global SUDOERS 58 | SUDOERS.add(config.OWNER_ID) 59 | sudoersdb = mongodb.sudoers 60 | sudoers = await sudoersdb.find_one({"sudo": "sudo"}) 61 | sudoers = sudoers["sudoers"] if sudoers else [] 62 | if config.OWNER_ID not in sudoers: 63 | sudoers.append(config.OWNER_ID) 64 | await sudoersdb.update_one( 65 | {"sudo": "sudo"}, 66 | {"$set": {"sudoers": sudoers}}, 67 | upsert=True, 68 | ) 69 | if sudoers: 70 | for user_id in sudoers: 71 | SUDOERS.add(user_id) 72 | LOGGER(__name__).info("Sudoers Loaded.") 73 | 74 | 75 | def heroku(): 76 | global HAPP 77 | if is_heroku and (config.HEROKU_API_KEY and config.HEROKU_APP_NAME): 78 | try: 79 | Heroku = heroku3.from_key(config.HEROKU_API_KEY) 80 | HAPP = Heroku.app(config.HEROKU_APP_NAME) 81 | LOGGER(__name__).info("Heroku App Configured") 82 | except BaseException: 83 | LOGGER(__name__).warning( 84 | f"Please make sure your Heroku API Key and Your App name are configured correctly in the heroku." 85 | ) 86 | -------------------------------------------------------------------------------- /AlexaMusic/platforms/Apple.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import re 14 | from typing import Union 15 | 16 | import aiohttp 17 | from bs4 import BeautifulSoup 18 | from youtubesearchpython.__future__ import VideosSearch 19 | 20 | 21 | class AppleAPI: 22 | def __init__(self): 23 | self.regex = r"^(https:\/\/music.apple.com\/)(.*)$" 24 | self.base = "https://music.apple.com/in/playlist/" 25 | 26 | async def valid(self, link: str): 27 | return bool(re.search(self.regex, link)) 28 | 29 | async def track(self, url, playid: Union[bool, str] = None): 30 | if playid: 31 | url = self.base + url 32 | async with aiohttp.ClientSession() as session: 33 | async with session.get(url) as response: 34 | if response.status != 200: 35 | return False 36 | html = await response.text() 37 | soup = BeautifulSoup(html, "html.parser") 38 | search = None 39 | for tag in soup.find_all("meta"): 40 | if tag.get("property", None) == "og:title": 41 | search = tag.get("content", None) 42 | if search is None: 43 | return False 44 | results = VideosSearch(search, limit=1) 45 | for result in (await results.next())["result"]: 46 | title = result["title"] 47 | ytlink = result["link"] 48 | vidid = result["id"] 49 | duration_min = result["duration"] 50 | thumbnail = result["thumbnails"][0]["url"].split("?")[0] 51 | track_details = { 52 | "title": title, 53 | "link": ytlink, 54 | "vidid": vidid, 55 | "duration_min": duration_min, 56 | "thumb": thumbnail, 57 | } 58 | return track_details, vidid 59 | 60 | async def playlist(self, url, playid: Union[bool, str] = None): 61 | if playid: 62 | url = self.base + url 63 | playlist_id = url.split("playlist/")[1] 64 | async with aiohttp.ClientSession() as session: 65 | async with session.get(url) as response: 66 | if response.status != 200: 67 | return False 68 | html = await response.text() 69 | soup = BeautifulSoup(html, "html.parser") 70 | applelinks = soup.find_all("meta", attrs={"property": "music:song"}) 71 | results = [] 72 | for item in applelinks: 73 | try: 74 | xx = (((item["content"]).split("album/")[1]).split("/")[0]).replace( 75 | "-", " " 76 | ) 77 | except Exception: 78 | xx = ((item["content"]).split("album/")[1]).split("/")[0] 79 | results.append(xx) 80 | return results, playlist_id 81 | -------------------------------------------------------------------------------- /AlexaMusic/platforms/Carbon.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import random 14 | from os.path import realpath 15 | 16 | import aiohttp 17 | from aiohttp import client_exceptions 18 | 19 | 20 | class UnableToFetchCarbon(Exception): 21 | pass 22 | 23 | 24 | themes = [ 25 | "3024-night", 26 | "a11y-dark", 27 | "blackboard", 28 | "base16-dark", 29 | "base16-light", 30 | "cobalt", 31 | "duotone-dark", 32 | "dracula-pro", 33 | "hopscotch", 34 | "lucario", 35 | "material", 36 | "monokai", 37 | "nightowl", 38 | "nord", 39 | "oceanic-next", 40 | "one-light", 41 | "one-dark", 42 | "panda-syntax", 43 | "parasio-dark", 44 | "seti", 45 | "shades-of-purple", 46 | "solarized+dark", 47 | "solarized+light", 48 | "synthwave-84", 49 | "twilight", 50 | "verminal", 51 | "vscode", 52 | "yeti", 53 | "zenburn", 54 | ] 55 | 56 | colour = [ 57 | "#FF0000", 58 | "#FF5733", 59 | "#FFFF00", 60 | "#008000", 61 | "#0000FF", 62 | "#800080", 63 | "#A52A2A", 64 | "#FF00FF", 65 | "#D2B48C", 66 | "#00FFFF", 67 | "#808000", 68 | "#800000", 69 | "#00FFFF", 70 | "#30D5C8", 71 | "#00FF00", 72 | "#008080", 73 | "#4B0082", 74 | "#EE82EE", 75 | "#FFC0CB", 76 | "#000000", 77 | "#FFFFFF", 78 | "#808080", 79 | ] 80 | 81 | 82 | class CarbonAPI: 83 | def __init__(self): 84 | self.language = "auto" 85 | self.drop_shadow = True 86 | self.drop_shadow_blur = "68px" 87 | self.drop_shadow_offset = "20px" 88 | self.font_family = "JetBrains Mono" 89 | self.width_adjustment = True 90 | self.watermark = False 91 | 92 | async def generate(self, text: str, user_id): 93 | async with aiohttp.ClientSession( 94 | headers={"Content-Type": "application/json"}, 95 | ) as ses: 96 | params = {"code": text, "backgroundColor": random.choice(colour)} 97 | params["theme"] = random.choice(themes) 98 | params["dropShadow"] = self.drop_shadow 99 | params["dropShadowOffsetY"] = self.drop_shadow_offset 100 | params["dropShadowBlurRadius"] = self.drop_shadow_blur 101 | params["fontFamily"] = self.font_family 102 | params["language"] = self.language 103 | params["watermark"] = self.watermark 104 | params["widthAdjustment"] = self.width_adjustment 105 | try: 106 | request = await ses.post( 107 | "https://carbonara.solopov.dev/api/cook", 108 | json=params, 109 | ) 110 | except client_exceptions.ClientConnectorError as e: 111 | raise UnableToFetchCarbon("Can not reach the Host!") from e 112 | resp = await request.read() 113 | with open(f"cache/carbon{user_id}.jpg", "wb") as f: 114 | f.write(resp) 115 | return realpath(f.name) 116 | -------------------------------------------------------------------------------- /AlexaMusic/platforms/Resso.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import re 13 | from typing import Union 14 | 15 | import aiohttp 16 | from bs4 import BeautifulSoup 17 | from youtubesearchpython.__future__ import VideosSearch 18 | 19 | 20 | class RessoAPI: 21 | def __init__(self): 22 | self.regex = r"^(https:\/\/m.resso.com\/)(.*)$" 23 | self.base = "https://m.resso.com/" 24 | 25 | async def valid(self, link: str): 26 | return bool(re.search(self.regex, link)) 27 | 28 | async def track(self, url, playid: Union[bool, str] = None): 29 | if playid: 30 | url = self.base + url 31 | async with aiohttp.ClientSession() as session: 32 | async with session.get(url) as response: 33 | if response.status != 200: 34 | return False 35 | html = await response.text() 36 | soup = BeautifulSoup(html, "html.parser") 37 | for tag in soup.find_all("meta"): 38 | if tag.get("property", None) == "og:title": 39 | title = tag.get("content", None) 40 | if tag.get("property", None) == "og:description": 41 | des = tag.get("content", None) 42 | try: 43 | des = des.split("·")[0] 44 | except Exception: 45 | pass 46 | if des == "": 47 | return 48 | results = VideosSearch(title, limit=1) 49 | for result in (await results.next())["result"]: 50 | title = result["title"] 51 | ytlink = result["link"] 52 | vidid = result["id"] 53 | duration_min = result["duration"] 54 | thumbnail = result["thumbnails"][0]["url"].split("?")[0] 55 | track_details = { 56 | "title": title, 57 | "link": ytlink, 58 | "vidid": vidid, 59 | "duration_min": duration_min, 60 | "thumb": thumbnail, 61 | } 62 | return track_details, vidid 63 | -------------------------------------------------------------------------------- /AlexaMusic/platforms/Soundcloud.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import asyncio 13 | from os import path 14 | 15 | from yt_dlp import YoutubeDL 16 | 17 | from AlexaMusic.utils.formatters import seconds_to_min 18 | 19 | 20 | class SoundAPI: 21 | def __init__(self): 22 | self.opts = { 23 | "outtmpl": "downloads/%(id)s.%(ext)s", 24 | "format": "bestaudio[ext=m4a]/bestaudio/best", 25 | "retries": 3, 26 | "nooverwrites": False, 27 | "continuedl": True, 28 | "quiet": True, 29 | } 30 | 31 | async def valid(self, link: str): 32 | return "soundcloud" in link and "sets" not in link 33 | 34 | async def download(self, url): 35 | d = YoutubeDL(self.opts) 36 | try: 37 | info = await asyncio.to_thread(d.extract_info, url) 38 | except Exception as e: 39 | print(f"Error: {e}") 40 | return False 41 | xyz = path.join("downloads", f"{info['id']}.{info['ext']}") 42 | duration_min = seconds_to_min(info["duration"]) 43 | track_details = { 44 | "title": info["title"], 45 | "duration_sec": info["duration"], 46 | "duration_min": duration_min, 47 | "uploader": info["uploader"], 48 | "filepath": xyz, 49 | } 50 | return track_details, xyz 51 | -------------------------------------------------------------------------------- /AlexaMusic/platforms/Spotify.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import re 14 | 15 | import spotipy 16 | from spotipy.oauth2 import SpotifyClientCredentials 17 | from youtubesearchpython.__future__ import VideosSearch 18 | 19 | import config 20 | 21 | 22 | class SpotifyAPI: 23 | def __init__(self): 24 | self.regex = r"^(https:\/\/open.spotify.com\/)(.*)$" 25 | self.client_id = config.SPOTIFY_CLIENT_ID 26 | self.client_secret = config.SPOTIFY_CLIENT_SECRET 27 | if config.SPOTIFY_CLIENT_ID and config.SPOTIFY_CLIENT_SECRET: 28 | self.client_credentials_manager = SpotifyClientCredentials( 29 | self.client_id, self.client_secret 30 | ) 31 | self.spotify = spotipy.Spotify( 32 | client_credentials_manager=self.client_credentials_manager 33 | ) 34 | else: 35 | self.spotify = None 36 | 37 | async def valid(self, link: str): 38 | return bool(re.search(self.regex, link)) 39 | 40 | async def track(self, link: str): 41 | track = self.spotify.track(link) 42 | info = track["name"] 43 | for artist in track["artists"]: 44 | fetched = f' {artist["name"]}' 45 | if "Various Artists" not in fetched: 46 | info += fetched 47 | results = VideosSearch(info, limit=1) 48 | for result in (await results.next())["result"]: 49 | ytlink = result["link"] 50 | title = result["title"] 51 | vidid = result["id"] 52 | duration_min = result["duration"] 53 | thumbnail = result["thumbnails"][0]["url"].split("?")[0] 54 | track_details = { 55 | "title": title, 56 | "link": ytlink, 57 | "vidid": vidid, 58 | "duration_min": duration_min, 59 | "thumb": thumbnail, 60 | } 61 | return track_details, vidid 62 | 63 | async def playlist(self, url): 64 | playlist = self.spotify.playlist(url) 65 | playlist_id = playlist["id"] 66 | results = [] 67 | for item in playlist["tracks"]["items"]: 68 | music_track = item["track"] 69 | info = music_track["name"] 70 | for artist in music_track["artists"]: 71 | fetched = f' {artist["name"]}' 72 | if "Various Artists" not in fetched: 73 | info += fetched 74 | results.append(info) 75 | return results, playlist_id 76 | 77 | async def album(self, url): 78 | album = self.spotify.album(url) 79 | album_id = album["id"] 80 | results = [] 81 | for item in album["tracks"]["items"]: 82 | info = item["name"] 83 | for artist in item["artists"]: 84 | fetched = f' {artist["name"]}' 85 | if "Various Artists" not in fetched: 86 | info += fetched 87 | results.append(info) 88 | 89 | return ( 90 | results, 91 | album_id, 92 | ) 93 | 94 | async def artist(self, url): 95 | artistinfo = self.spotify.artist(url) 96 | artist_id = artistinfo["id"] 97 | results = [] 98 | artisttoptracks = self.spotify.artist_top_tracks(url) 99 | for item in artisttoptracks["tracks"]: 100 | info = item["name"] 101 | for artist in item["artists"]: 102 | fetched = f' {artist["name"]}' 103 | if "Various Artists" not in fetched: 104 | info += fetched 105 | results.append(info) 106 | 107 | return results, artist_id 108 | -------------------------------------------------------------------------------- /AlexaMusic/platforms/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from .Apple import AppleAPI 14 | from .Carbon import CarbonAPI 15 | from .Resso import RessoAPI 16 | from .Soundcloud import SoundAPI 17 | from .Spotify import SpotifyAPI 18 | from .Telegram import TeleAPI 19 | from .Youtube import YouTubeAPI 20 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import glob 14 | from os.path import dirname, isfile 15 | 16 | 17 | def __list_all_modules(): 18 | work_dir = dirname(__file__) 19 | mod_paths = glob.glob(f"{work_dir}/*/*.py") 20 | 21 | return [ 22 | (((f.replace(work_dir, "")).replace("/", "."))[:-3]) 23 | for f in mod_paths 24 | if isfile(f) and f.endswith(".py") and not f.endswith("__init__.py") 25 | ] 26 | 27 | 28 | ALL_MODULES = sorted(__list_all_modules()) 29 | __all__ = ALL_MODULES + ["ALL_MODULES"] 30 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/loop.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.utils.database.memorydatabase import get_loop, set_loop 20 | from AlexaMusic.utils.decorators import AdminRightsCheck 21 | 22 | # Commands 23 | LOOP_COMMAND = get_command("LOOP_COMMAND") 24 | 25 | 26 | @app.on_message(filters.command(LOOP_COMMAND) & filters.group & ~BANNED_USERS) 27 | @AdminRightsCheck 28 | async def admins(cli, message: Message, _, chat_id): 29 | usage = _["admin_24"] 30 | if len(message.command) != 2: 31 | return await message.reply_text(usage) 32 | state = message.text.split(None, 1)[1].strip() 33 | if state.isnumeric(): 34 | state = int(state) 35 | if 1 <= state <= 10: 36 | got = await get_loop(chat_id) 37 | if got != 0: 38 | state = got + state 39 | state = min(state, 10) 40 | await set_loop(chat_id, state) 41 | return await message.reply_text( 42 | _["admin_25"].format(message.from_user.first_name, state) 43 | ) 44 | else: 45 | return await message.reply_text(_["admin_26"]) 46 | elif state.lower() == "enable": 47 | await set_loop(chat_id, 10) 48 | return await message.reply_text( 49 | _["admin_25"].format(message.from_user.first_name, state) 50 | ) 51 | elif state.lower() == "disable": 52 | await set_loop(chat_id, 0) 53 | return await message.reply_text(_["admin_27"]) 54 | else: 55 | return await message.reply_text(usage) 56 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/mute.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.core.call import Alexa 20 | from AlexaMusic.utils.database import is_muted, mute_on 21 | from AlexaMusic.utils.decorators import AdminRightsCheck 22 | 23 | # Commands 24 | MUTE_COMMAND = get_command("MUTE_COMMAND") 25 | 26 | 27 | @app.on_message(filters.command(MUTE_COMMAND) & filters.group & ~BANNED_USERS) 28 | @AdminRightsCheck 29 | async def mute_admin(cli, message: Message, _, chat_id): 30 | if len(message.command) != 1 or message.reply_to_message: 31 | return await message.reply_text(_["general_2"]) 32 | if await is_muted(chat_id): 33 | return await message.reply_text(_["admin_5"], disable_web_page_preview=True) 34 | await mute_on(chat_id) 35 | await Alexa.mute_stream(chat_id) 36 | await message.reply_text( 37 | _["admin_6"].format(message.from_user.mention), disable_web_page_preview=True 38 | ) 39 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/pause.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.core.call import Alexa 20 | from AlexaMusic.utils.database import is_music_playing, music_off 21 | from AlexaMusic.utils.decorators import AdminRightsCheck 22 | 23 | # Commands 24 | PAUSE_COMMAND = get_command("PAUSE_COMMAND") 25 | 26 | 27 | @app.on_message(filters.command(PAUSE_COMMAND) & filters.group & ~BANNED_USERS) 28 | @AdminRightsCheck 29 | async def pause_admin(cli, message: Message, _, chat_id): 30 | if len(message.command) != 1: 31 | return await message.reply_text(_["general_2"]) 32 | if not await is_music_playing(chat_id): 33 | return await message.reply_text(_["admin_1"], disable_web_page_preview=True) 34 | await music_off(chat_id) 35 | await Alexa.pause_stream(chat_id) 36 | await message.reply_text( 37 | _["admin_2"].format(message.from_user.mention), disable_web_page_preview=True 38 | ) 39 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/resume.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.core.call import Alexa 20 | from AlexaMusic.utils.database import is_music_playing, music_on 21 | from AlexaMusic.utils.decorators import AdminRightsCheck 22 | 23 | # Commands 24 | RESUME_COMMAND = get_command("RESUME_COMMAND") 25 | 26 | 27 | @app.on_message(filters.command(RESUME_COMMAND) & filters.group & ~BANNED_USERS) 28 | @AdminRightsCheck 29 | async def resume_com(cli, message: Message, _, chat_id): 30 | if len(message.command) != 1: 31 | return await message.reply_text(_["general_2"]) 32 | if await is_music_playing(chat_id): 33 | return await message.reply_text(_["admin_3"], disable_web_page_preview=True) 34 | await music_on(chat_id) 35 | await Alexa.resume_stream(chat_id) 36 | await message.reply_text( 37 | _["admin_4"].format(message.from_user.mention), disable_web_page_preview=True 38 | ) 39 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/seek.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import YouTube, app 19 | from AlexaMusic.core.call import Alexa 20 | from AlexaMusic.misc import db 21 | from AlexaMusic.utils import AdminRightsCheck, seconds_to_min 22 | 23 | # Commands 24 | SEEK_COMMAND = get_command("SEEK_COMMAND") 25 | 26 | 27 | @app.on_message(filters.command(SEEK_COMMAND) & filters.group & ~BANNED_USERS) 28 | @AdminRightsCheck 29 | async def seek_comm(cli, message: Message, _, chat_id): 30 | if len(message.command) == 1: 31 | return await message.reply_text(_["admin_28"]) 32 | query = message.text.split(None, 1)[1].strip() 33 | if not query.isnumeric(): 34 | return await message.reply_text(_["admin_29"]) 35 | playing = db.get(chat_id) 36 | if not playing: 37 | return await message.reply_text(_["queue_2"]) 38 | duration_seconds = int(playing[0]["seconds"]) 39 | if duration_seconds == 0: 40 | return await message.reply_text(_["admin_30"]) 41 | file_path = playing[0]["file"] 42 | if "index_" in file_path or "live_" in file_path: 43 | return await message.reply_text(_["admin_30"]) 44 | duration_played = int(playing[0]["played"]) 45 | duration_to_skip = int(query) 46 | duration = playing[0]["dur"] 47 | if message.command[0][-2] == "c": 48 | if (duration_played - duration_to_skip) <= 10: 49 | return await message.reply_text( 50 | _["admin_31"].format(seconds_to_min(duration_played), duration) 51 | ) 52 | to_seek = duration_played - duration_to_skip + 1 53 | elif (duration_seconds - (duration_played + duration_to_skip)) <= 10: 54 | return await message.reply_text( 55 | _["admin_31"].format(seconds_to_min(duration_played), duration) 56 | ) 57 | else: 58 | to_seek = duration_played + duration_to_skip + 1 59 | mystic = await message.reply_text(_["admin_32"]) 60 | if "vid_" in file_path: 61 | n, file_path = await YouTube.video(playing[0]["vidid"], True) 62 | if n == 0: 63 | return await message.reply_text(_["admin_30"]) 64 | try: 65 | await Alexa.seek_stream( 66 | chat_id, 67 | file_path, 68 | seconds_to_min(to_seek), 69 | duration, 70 | playing[0]["streamtype"], 71 | ) 72 | except Exception: 73 | return await mystic.edit_text(_["admin_34"]) 74 | if message.command[0][-2] == "c": 75 | db[chat_id][0]["played"] -= duration_to_skip 76 | else: 77 | db[chat_id][0]["played"] += duration_to_skip 78 | await mystic.edit_text(_["admin_33"].format(seconds_to_min(to_seek))) 79 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/shuffle.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import random 14 | 15 | from pyrogram import filters 16 | from pyrogram.types import Message 17 | 18 | from config import BANNED_USERS 19 | from strings import get_command 20 | from AlexaMusic import app 21 | from AlexaMusic.misc import db 22 | from AlexaMusic.utils.decorators import AdminRightsCheck 23 | 24 | # Commands 25 | SHUFFLE_COMMAND = get_command("SHUFFLE_COMMAND") 26 | 27 | 28 | @app.on_message(filters.command(SHUFFLE_COMMAND) & filters.group & ~BANNED_USERS) 29 | @AdminRightsCheck 30 | async def admins(Client, message: Message, _, chat_id): 31 | if len(message.command) != 1: 32 | return await message.reply_text(_["general_2"]) 33 | check = db.get(chat_id) 34 | if not check: 35 | return await message.reply_text(_["admin_21"]) 36 | try: 37 | popped = check.pop(0) 38 | except Exception: 39 | return await message.reply_text(_["admin_22"]) 40 | check = db.get(chat_id) 41 | if not check: 42 | check.insert(0, popped) 43 | return await message.reply_text(_["admin_22"]) 44 | random.shuffle(check) 45 | check.insert(0, popped) 46 | await message.reply_text(_["admin_23"].format(message.from_user.first_name)) 47 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/stop.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from pyrogram import filters 13 | from pyrogram.types import Message 14 | from config import BANNED_USERS 15 | from strings import get_command 16 | from AlexaMusic import app 17 | from AlexaMusic.core.call import Alexa 18 | from AlexaMusic.utils.database import set_loop 19 | from AlexaMusic.utils.decorators import AdminRightsCheck 20 | 21 | # Commands 22 | STOP_COMMAND = get_command("STOP_COMMAND") 23 | 24 | 25 | @app.on_message(filters.command(STOP_COMMAND) & filters.group & ~BANNED_USERS) 26 | @AdminRightsCheck 27 | async def stop_music(cli, message: Message, _, chat_id): 28 | if len(message.command) != 1: 29 | return await message.reply_text(_["general_2"]) 30 | await Alexa.stop_stream(chat_id) 31 | await set_loop(chat_id, 0) 32 | await message.reply_text( 33 | _["admin_9"].format(message.from_user.mention), disable_web_page_preview=True 34 | ) 35 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/admins/unmute.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.core.call import Alexa 20 | from AlexaMusic.utils.database import is_muted, mute_off 21 | from AlexaMusic.utils.decorators import AdminRightsCheck 22 | 23 | # Commands 24 | UNMUTE_COMMAND = get_command("UNMUTE_COMMAND") 25 | 26 | 27 | @app.on_message(filters.command(UNMUTE_COMMAND) & filters.group & ~BANNED_USERS) 28 | @AdminRightsCheck 29 | async def unmute_admin(Client, message: Message, _, chat_id): 30 | if len(message.command) != 1 or message.reply_to_message: 31 | return await message.reply_text(_["general_2"]) 32 | if not await is_muted(chat_id): 33 | return await message.reply_text(_["admin_7"], disable_web_page_preview=True) 34 | await mute_off(chat_id) 35 | await Alexa.unmute_stream(chat_id) 36 | await message.reply_text( 37 | _["admin_8"].format(message.from_user.mention), disable_web_page_preview=True 38 | ) 39 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/bot/help.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from typing import Union 14 | 15 | from pyrogram import filters, types 16 | from pyrogram.types import InlineKeyboardMarkup, Message 17 | 18 | from config import BANNED_USERS 19 | from strings import get_command, get_string, helpers 20 | from AlexaMusic import app 21 | from AlexaMusic.misc import SUDOERS 22 | from AlexaMusic.utils import help_pannel 23 | from AlexaMusic.utils.database import get_lang, is_commanddelete_on 24 | from AlexaMusic.utils.decorators.language import LanguageStart, languageCB 25 | from AlexaMusic.utils.inline.help import help_back_markup, private_help_panel 26 | 27 | ### Command 28 | HELP_COMMAND = get_command("HELP_COMMAND") 29 | 30 | 31 | @app.on_message(filters.command(HELP_COMMAND) & filters.private & ~BANNED_USERS) 32 | @app.on_callback_query(filters.regex("settings_back_helper") & ~BANNED_USERS) 33 | async def helper_private( 34 | client: app, update: Union[types.Message, types.CallbackQuery] 35 | ): 36 | is_callback = isinstance(update, types.CallbackQuery) 37 | if is_callback: 38 | try: 39 | await update.answer() 40 | except Exception: 41 | pass 42 | chat_id = update.message.chat.id 43 | language = await get_lang(chat_id) 44 | _ = get_string(language) 45 | keyboard = help_pannel(_, True) 46 | if update.message.photo: 47 | await update.message.delete() 48 | await update.message.reply_text(_["help_1"], reply_markup=keyboard) 49 | else: 50 | await update.edit_message_text(_["help_1"], reply_markup=keyboard) 51 | else: 52 | chat_id = update.chat.id 53 | if await is_commanddelete_on(update.chat.id): 54 | try: 55 | await update.delete() 56 | except Exception: 57 | pass 58 | language = await get_lang(chat_id) 59 | _ = get_string(language) 60 | keyboard = help_pannel(_) 61 | await update.reply_text(_["help_1"], reply_markup=keyboard) 62 | 63 | 64 | @app.on_message(filters.command(HELP_COMMAND) & filters.group & ~BANNED_USERS) 65 | @LanguageStart 66 | async def help_com_group(client, message: Message, _): 67 | keyboard = private_help_panel(_) 68 | await message.reply_text(_["help_2"], reply_markup=InlineKeyboardMarkup(keyboard)) 69 | 70 | 71 | @app.on_callback_query(filters.regex("help_callback") & ~BANNED_USERS) 72 | @languageCB 73 | async def helper_cb(client, CallbackQuery, _): 74 | callback_data = CallbackQuery.data.strip() 75 | cb = callback_data.split(None, 1)[1] 76 | keyboard = help_back_markup(_) 77 | if cb == "hb5": 78 | if CallbackQuery.from_user.id not in SUDOERS: 79 | return await CallbackQuery.answer( 80 | "ᴏɴʟʏ ғᴏʀ ᴏᴡɴᴇʀ ᴀɴᴅ sᴜᴅᴏᴇʀs", show_alert=True 81 | ) 82 | await CallbackQuery.edit_message_text(helpers.HELP_5, reply_markup=keyboard) 83 | return await CallbackQuery.answer() 84 | try: 85 | await CallbackQuery.answer() 86 | except Exception: 87 | pass 88 | if cb == "hb1": 89 | await CallbackQuery.edit_message_text(helpers.HELP_1, reply_markup=keyboard) 90 | elif cb == "hb2": 91 | await CallbackQuery.edit_message_text(helpers.HELP_2, reply_markup=keyboard) 92 | elif cb == "hb3": 93 | await CallbackQuery.edit_message_text(helpers.HELP_3, reply_markup=keyboard) 94 | elif cb == "hb4": 95 | await CallbackQuery.edit_message_text(helpers.HELP_4, reply_markup=keyboard) 96 | elif cb == "hb7": 97 | await CallbackQuery.edit_message_text(helpers.HELP_7, reply_markup=keyboard) 98 | elif cb == "hb8": 99 | await CallbackQuery.edit_message_text(helpers.HELP_8, reply_markup=keyboard) 100 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/bot/inline.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram.types import ( 14 | InlineKeyboardButton, 15 | InlineKeyboardMarkup, 16 | InlineQueryResultPhoto, 17 | ) 18 | from youtubesearchpython.__future__ import VideosSearch 19 | 20 | from config import BANNED_USERS, MUSIC_BOT_NAME 21 | from AlexaMusic import app 22 | from AlexaMusic.utils.inlinequery import answer 23 | 24 | 25 | @app.on_inline_query(~BANNED_USERS) 26 | async def inline_query_handler(client, query): 27 | text = query.query.strip().lower() 28 | if text.strip() == "": 29 | try: 30 | await client.answer_inline_query(query.id, results=answer, cache_time=10) 31 | except Exception: 32 | return 33 | else: 34 | a = VideosSearch(text, limit=20) 35 | result = (await a.next()).get("result") 36 | answers = [] 37 | for x in range(15): 38 | title = (result[x]["title"]).title() 39 | duration = result[x]["duration"] 40 | views = result[x]["viewCount"]["short"] 41 | thumbnail = result[x]["thumbnails"][0]["url"].split("?")[0] 42 | channellink = result[x]["channel"]["link"] 43 | channel = result[x]["channel"]["name"] 44 | link = result[x]["link"] 45 | published = result[x]["publishedTime"] 46 | description = f"{views} | {duration} Mins | {channel} | {published}" 47 | buttons = InlineKeyboardMarkup( 48 | [ 49 | [ 50 | InlineKeyboardButton( 51 | text="• ʏᴏᴜᴛᴜʙᴇ •", 52 | url=link, 53 | ) 54 | ], 55 | ] 56 | ) 57 | searched_text = f""" 58 | 📌**ᴛɪᴛʟᴇ:** [{title}]({link}) 59 | 60 | ⏳**ᴅᴜʀᴀᴛɪᴏɴ:** {duration} Mins 61 | 👀**ᴠɪᴇᴡs:** `{views}` 62 | ⏰**ᴩᴜʙʟɪsʜᴇᴅ ᴏɴ:** {published} 63 | 🎥**ᴄʜᴀɴɴᴇʟ:** {channel} 64 | 📎**ᴄʜᴀɴɴᴇʟ ʟɪɴᴋ:** [ᴠɪsɪᴛ ᴄʜᴀɴɴᴇʟ]({channellink}) 65 | 66 | 💖 ** sᴇᴀʀᴄʜ ᴩᴏᴡᴇʀᴇᴅ ʙʏ {MUSIC_BOT_NAME} **""" 67 | answers.append( 68 | InlineQueryResultPhoto( 69 | photo_url=thumbnail, 70 | title=title, 71 | thumb_url=thumbnail, 72 | description=description, 73 | caption=searched_text, 74 | reply_markup=buttons, 75 | ) 76 | ) 77 | try: 78 | return await client.answer_inline_query(query.id, results=answers) 79 | except Exception: 80 | return 81 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/misc/autoleave.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import asyncio 13 | from datetime import datetime 14 | from pyrogram.enums import ChatType 15 | 16 | import config 17 | from AlexaMusic import app 18 | from AlexaMusic.core.call import Alexa, autoend 19 | from AlexaMusic.utils.database import ( 20 | get_client, 21 | is_active_chat, 22 | is_autoend, 23 | ) 24 | 25 | autoend = {} 26 | 27 | 28 | async def auto_leave(): 29 | if config.AUTO_LEAVING_ASSISTANT != str(True): 30 | return 31 | while not await asyncio.sleep(config.AUTO_LEAVE_ASSISTANT_TIME): 32 | from AlexaMusic.core.userbot import assistants 33 | 34 | for num in assistants: 35 | client = await get_client(num) 36 | try: 37 | async for i in client.get_dialogs(): 38 | chat_type = i.chat.type 39 | if chat_type in [ 40 | ChatType.SUPERGROUP, 41 | ChatType.GROUP, 42 | ChatType.CHANNEL, 43 | ]: 44 | chat_id = i.chat.id 45 | if chat_id not in [ 46 | config.LOG_GROUP_ID, 47 | -1001686672798, 48 | ] and not await is_active_chat(chat_id): 49 | try: 50 | await client.leave_chat(chat_id) 51 | except Exception: 52 | continue 53 | except Exception: 54 | pass 55 | 56 | 57 | asyncio.create_task(auto_leave()) 58 | 59 | 60 | async def auto_end(): 61 | while not await asyncio.sleep(30): 62 | if not await is_autoend(): 63 | continue 64 | for chat_id in autoend: 65 | timer = autoend.get(chat_id) 66 | if not timer: 67 | continue 68 | if datetime.now() > timer: 69 | if not await is_active_chat(chat_id): 70 | autoend[chat_id] = {} 71 | continue 72 | autoend[chat_id] = {} 73 | try: 74 | await Alexa.stop_stream(chat_id) 75 | except Exception: 76 | continue 77 | try: 78 | await app.send_message( 79 | chat_id, 80 | "» ʙᴏᴛ ᴀᴜᴛᴏᴍᴀᴛɪᴄᴀʟʟʏ ʟᴇғᴛ ᴠɪᴅᴇᴏᴄʜᴀᴛ ʙᴇᴄᴀᴜsᴇ ɴᴏ ᴏɴᴇ ᴡᴀs ʟɪsᴛᴇɴɪɴɢ ᴏɴ ᴠɪᴅᴇᴏᴄʜᴀᴛ.", 81 | ) 82 | except Exception: 83 | continue 84 | 85 | 86 | asyncio.create_task(auto_end()) 87 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/misc/seeker.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | 15 | from pyrogram.types import InlineKeyboardMarkup 16 | from datetime import datetime, timedelta 17 | 18 | from strings import get_string 19 | from AlexaMusic.misc import db 20 | from AlexaMusic.utils.database import ( 21 | get_active_chats, 22 | get_lang, 23 | is_music_playing, 24 | get_assistant, 25 | ) 26 | from AlexaMusic.utils.formatters import seconds_to_min 27 | from AlexaMusic.utils.inline import stream_markup_timer, telegram_markup_timer 28 | 29 | from ..admins.callback import wrong 30 | from .autoleave import autoend 31 | 32 | checker = {} 33 | 34 | 35 | async def timer(): 36 | while not await asyncio.sleep(1): 37 | active_chats = await get_active_chats() 38 | for chat_id in active_chats: 39 | if not await is_music_playing(chat_id): 40 | continue 41 | playing = db.get(chat_id) 42 | if not playing: 43 | continue 44 | file_path = playing[0]["file"] 45 | if "index_" in file_path or "live_" in file_path: 46 | continue 47 | duration = int(playing[0]["seconds"]) 48 | if duration == 0: 49 | continue 50 | db[chat_id][0]["played"] += 1 51 | 52 | 53 | asyncio.create_task(timer()) 54 | 55 | 56 | async def markup_timer(): 57 | while not await asyncio.sleep(4): 58 | active_chats = await get_active_chats() 59 | for chat_id in active_chats: 60 | try: 61 | if not await is_music_playing(chat_id): 62 | continue 63 | playing = db.get(chat_id) 64 | if not playing: 65 | continue 66 | duration_seconds = int(playing[0]["seconds"]) 67 | if duration_seconds == 0: 68 | continue 69 | try: 70 | mystic = playing[0]["mystic"] 71 | markup = playing[0]["markup"] 72 | except Exception: 73 | continue 74 | try: 75 | check = wrong[chat_id][mystic.id] 76 | if check is False: 77 | continue 78 | except Exception: 79 | pass 80 | try: 81 | language = await get_lang(chat_id) 82 | _ = get_string(language) 83 | except Exception: 84 | _ = get_string("en") 85 | userbot = await get_assistant(chat_id) 86 | if chat_id not in autoend: 87 | try: 88 | members = [] 89 | async for member in userbot.get_call_members(chat_id): 90 | if member is None: 91 | continue 92 | members.append(member) 93 | if len(members) <= 1: 94 | autoend[chat_id] = datetime.now() + timedelta(seconds=60) 95 | except Exception: 96 | pass # Passing this for don't affect the below button edition function 97 | try: 98 | buttons = ( 99 | stream_markup_timer( 100 | _, 101 | playing[0]["vidid"], 102 | chat_id, 103 | seconds_to_min(playing[0]["played"]), 104 | playing[0]["dur"], 105 | ) 106 | if markup == "stream" 107 | else telegram_markup_timer( 108 | _, 109 | chat_id, 110 | seconds_to_min(playing[0]["played"]), 111 | playing[0]["dur"], 112 | ) 113 | ) 114 | await mystic.edit_reply_markup( 115 | reply_markup=InlineKeyboardMarkup(buttons) 116 | ) 117 | except Exception: 118 | continue 119 | except Exception: 120 | continue 121 | 122 | 123 | asyncio.create_task(markup_timer()) 124 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/misc/suggestion.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | import random 15 | from datetime import datetime, timedelta 16 | 17 | import config 18 | from config import clean 19 | from strings import get_string 20 | from AlexaMusic import app 21 | from AlexaMusic.utils.database import ( 22 | get_lang, 23 | get_private_served_chats, 24 | get_served_chats, 25 | is_suggestion, 26 | ) 27 | 28 | LEAVE_TIME = config.AUTO_SUGGESTION_TIME 29 | 30 | 31 | suggestor = {} 32 | 33 | strings = [item for item in get_string("en") if item[:3] == "sug" and item != "sug_0"] 34 | 35 | 36 | async def dont_do_this(): 37 | if config.AUTO_SUGGESTION_MODE != str(True): 38 | return 39 | while not await asyncio.sleep(LEAVE_TIME): 40 | try: 41 | chats = [] 42 | if config.PRIVATE_BOT_MODE == str(True): 43 | schats = await get_private_served_chats() 44 | else: 45 | schats = await get_served_chats() 46 | for chat in schats: 47 | chats.append(int(chat["chat_id"])) 48 | total = len(chats) 49 | if total >= 100: 50 | total //= 10 51 | send_to = 0 52 | random.shuffle(chats) 53 | for x in chats: 54 | if send_to == total: 55 | break 56 | if x == config.LOG_GROUP_ID: 57 | continue 58 | if not await is_suggestion(x): 59 | continue 60 | try: 61 | language = await get_lang(x) 62 | _ = get_string(language) 63 | except Exception: 64 | _ = get_string("en") 65 | string = random.choice(strings) 66 | if previous := suggestor.get(x): 67 | while previous == (string.split("_")[1]): 68 | string = random.choice(strings) 69 | suggestor[x] = string.split("_")[1] 70 | try: 71 | msg = _["sug_0"] + _[string] 72 | sent = await app.send_message(x, msg) 73 | if x not in clean: 74 | clean[x] = [] 75 | time_now = datetime.now() 76 | put = { 77 | "msg_id": sent.message_id, 78 | "timer_after": time_now 79 | + timedelta(minutes=config.CLEANMODE_DELETE_MINS), 80 | } 81 | clean[x].append(put) 82 | send_to += 1 83 | except Exception: 84 | pass 85 | except Exception: 86 | pass 87 | 88 | 89 | asyncio.create_task(dont_do_this()) 90 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/modules/botwelcomlog.py: -------------------------------------------------------------------------------- 1 | # This code is written by (C) TheTeamAlexa bot will send message to log group when someone add 2 | # this bot to new group make sure to star all projects 3 | # Copyright (C) 2021-2025 by Alexa_Help@ Github, < TheTeamAlexa >. 4 | # All rights reserved. © Alexa © Yukki 5 | 6 | from pyrogram import filters 7 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message 8 | from config import LOG, LOG_GROUP_ID 9 | from AlexaMusic import app 10 | from AlexaMusic.utils.database import delete_served_chat, get_assistant, is_on_off 11 | 12 | 13 | @app.on_message(filters.new_chat_members) 14 | async def bot_added(_, message): 15 | try: 16 | if not await is_on_off(LOG): 17 | return 18 | userbot = await get_assistant(message.chat.id) 19 | chat = message.chat 20 | for members in message.new_chat_members: 21 | if members.id == app.id: 22 | count = await app.get_chat_members_count(chat.id) 23 | username = message.chat.username or "Private Chat" 24 | msg = ( 25 | f"Bot added in {message.chat.title}\n\n" 26 | f"Name: {message.chat.title}\n" 27 | f"Id: {message.chat.id}\n" 28 | f"Username: @{username}\n" 29 | f"Added By: {message.from_user.mention}" 30 | ) 31 | await app.send_message( 32 | LOG_GROUP_ID, 33 | text=msg, 34 | reply_markup=InlineKeyboardMarkup( 35 | [ 36 | [ 37 | InlineKeyboardButton( 38 | text=f"Added by: {message.from_user.first_name}", 39 | user_id=message.from_user.id, 40 | ) 41 | ] 42 | ] 43 | ), 44 | ) 45 | if message.chat.username: 46 | await userbot.join_chat(message.chat.username) 47 | except Exception: 48 | pass 49 | 50 | 51 | @app.on_message(filters.left_chat_member) 52 | async def bot_kicked(_, message: Message): 53 | try: 54 | if not await is_on_off(LOG): 55 | return 56 | userbot = await get_assistant(message.chat.id) 57 | left_chat_member = message.left_chat_member 58 | if left_chat_member and left_chat_member.id == app.id: 59 | remove_by = ( 60 | message.from_user.mention if message.from_user else "Unknown User" 61 | ) 62 | title = message.chat.title 63 | username = ( 64 | f"@{message.chat.username}" if message.chat.username else "Private Chat" 65 | ) 66 | chat_id = message.chat.id 67 | left = ( 68 | f"Bot was Removed in {title}\n" 69 | f"Name: {title}\n" 70 | f"Id: {chat_id}\n" 71 | f"Username: {username}\n" 72 | f"Removed By: {remove_by}" 73 | ) 74 | 75 | await app.send_message( 76 | LOG_GROUP_ID, 77 | text=left, 78 | reply_markup=InlineKeyboardMarkup( 79 | [ 80 | [ 81 | InlineKeyboardButton( 82 | text=f"Removed By: {message.from_user.first_name}", 83 | user_id=message.from_user.id, 84 | ) 85 | ] 86 | ] 87 | ), 88 | ) 89 | await delete_served_chat(chat_id) 90 | await userbot.leave_chat(chat_id) 91 | except Exception as e: 92 | pass 93 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/modules/id.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from AlexaMusic import app 13 | from pyrogram import filters 14 | 15 | 16 | @app.on_message(filters.command("id")) 17 | def ids(_, message): 18 | if reply := message.reply_to_message: 19 | message.reply_text( 20 | f"**ʏᴏᴜʀ ɪᴅ**: `{message.from_user.id}`\n**{reply.from_user.first_name}'s ɪᴅ**: `{reply.from_user.id}`\n**ᴄʜᴀᴛ ɪᴅ**: `{message.chat.id}`" 21 | ) 22 | else: 23 | message.reply( 24 | f"**ʏᴏᴜʀ ɪᴅ**: `{message.from_user.id}`\n**ᴄʜᴀᴛ ɪᴅ**: `{message.chat.id}`" 25 | ) 26 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/modules/paidsub.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | from AlexaMusic import app 15 | from pyrogram import Client, filters 16 | from datetime import datetime, timedelta 17 | from pyrogram.errors import FloodWait 18 | from AlexaMusic.core.mongo import db as alexa 19 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 20 | from AlexaMusic.utils.database import get_served_users, get_served_chats 21 | 22 | 23 | OWNER_ID = 6174058850 24 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/play/channel.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with a variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collab if you have new ideas. 10 | """ 11 | 12 | from AlexaMusic import app 13 | from pyrogram import filters 14 | from config import BANNED_USERS 15 | from strings import get_command 16 | from pyrogram.types import Message 17 | from AlexaMusic.utils.database import set_cmode 18 | from AlexaMusic.utils.decorators.admins import AdminActual 19 | from pyrogram.enums import ChatMembersFilter, ChatMemberStatus, ChatType 20 | 21 | ### Multi-Lang Commands 22 | CHANNELPLAY_COMMAND = get_command("CHANNELPLAY_COMMAND") 23 | 24 | 25 | @app.on_message(filters.command(CHANNELPLAY_COMMAND) & filters.group & ~BANNED_USERS) 26 | @AdminActual 27 | async def playmode_(client, message: Message, _): 28 | if len(message.command) < 2: 29 | return await message.reply_text( 30 | _["cplay_1"].format(message.chat.title, CHANNELPLAY_COMMAND[0]) 31 | ) 32 | query = message.text.split(None, 2)[1].lower().strip() 33 | if (str(query)).lower() == "disable": 34 | await set_cmode(message.chat.id, None) 35 | return await message.reply_text("Channel Play Disabled") 36 | elif str(query) == "linked": 37 | chat = await app.get_chat(message.chat.id) 38 | if not chat.linked_chat: 39 | return await message.reply_text(_["cplay_2"]) 40 | chat_id = chat.linked_chat.id 41 | await set_cmode(message.chat.id, chat_id) 42 | return await message.reply_text( 43 | _["cplay_3"].format(chat.linked_chat.title, chat.linked_chat.id) 44 | ) 45 | else: 46 | try: 47 | chat = await app.get_chat(query) 48 | except Exception as e: 49 | print(f"Error: {e}") 50 | return await message.reply_text(_["cplay_4"]) 51 | if chat.type != ChatType.CHANNEL: 52 | return await message.reply_text(_["cplay_5"]) 53 | try: 54 | async for user in app.get_chat_members( 55 | chat.id, filter=ChatMembersFilter.ADMINISTRATORS 56 | ): 57 | if user.status == ChatMemberStatus.OWNER: 58 | creatorusername = user.user.username 59 | creatorid = user.user.id 60 | except Exception as e: 61 | print(f"Error: {e}") 62 | return await message.reply_text(_["cplay_4"]) 63 | if creatorid != message.from_user.id: 64 | return await message.reply_text( 65 | _["cplay_6"].format(chat.title, creatorusername) 66 | ) 67 | await set_cmode(message.chat.id, chat.id) 68 | return await message.reply_text(_["cplay_3"].format(chat.title, chat.id)) 69 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/play/live.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from pyrogram import filters 13 | 14 | from AlexaMusic import YouTube, app 15 | from AlexaMusic.utils.channelplay import get_channeplayCB 16 | from AlexaMusic.utils.decorators.language import languageCB 17 | from AlexaMusic.utils.stream.stream import stream 18 | from config import BANNED_USERS 19 | 20 | 21 | @app.on_callback_query(filters.regex("LiveStream") & ~BANNED_USERS) 22 | @languageCB 23 | async def play_live_stream(client, CallbackQuery, _): 24 | callback_data = CallbackQuery.data.strip() 25 | callback_request = callback_data.split(None, 1)[1] 26 | vidid, user_id, mode, cplay, fplay = callback_request.split("|") 27 | if CallbackQuery.from_user.id != int(user_id): 28 | try: 29 | return await CallbackQuery.answer(_["playcb_1"], show_alert=True) 30 | except Exception: 31 | return 32 | try: 33 | chat_id, channel = await get_channeplayCB(_, cplay, CallbackQuery) 34 | except Exception: 35 | return 36 | video = True if mode == "v" else None 37 | user_name = CallbackQuery.from_user.first_name 38 | await CallbackQuery.message.delete() 39 | try: 40 | await CallbackQuery.answer() 41 | except Exception: 42 | pass 43 | mystic = await CallbackQuery.message.reply_text( 44 | _["play_2"].format(channel) if channel else _["play_1"] 45 | ) 46 | try: 47 | details, track_id = await YouTube.track(vidid, True) 48 | except Exception: 49 | return await mystic.edit_text(_["play_3"]) 50 | ffplay = True if fplay == "f" else None 51 | if details["duration_min"]: 52 | return await mystic.edit_text("ɪ ᴅᴏɴ'ᴛ ᴛʜɪɴᴋ ᴛʜᴀᴛ ɪᴛ's ᴀ ʟɪᴠᴇ sᴛʀᴇᴀᴍ.") 53 | try: 54 | await stream( 55 | _, 56 | mystic, 57 | user_id, 58 | details, 59 | chat_id, 60 | user_name, 61 | CallbackQuery.message.chat.id, 62 | video, 63 | streamtype="live", 64 | forceplay=ffplay, 65 | ) 66 | except Exception as e: 67 | ex_type = type(e).__name__ 68 | err = e if ex_type == "AssistantErr" else _["general_3"].format(ex_type) 69 | return await mystic.edit_text(err) 70 | await mystic.delete() 71 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/play/playmode.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import InlineKeyboardMarkup, Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.utils.database import get_playmode, get_playtype, is_nonadmin_chat 20 | from AlexaMusic.utils.decorators import language 21 | from AlexaMusic.utils.inline.settings import playmode_users_markup 22 | 23 | ### Commands 24 | PLAYMODE_COMMAND = get_command("PLAYMODE_COMMAND") 25 | 26 | 27 | @app.on_message(filters.command(PLAYMODE_COMMAND) & filters.group & ~BANNED_USERS) 28 | @language 29 | async def playmode_(client, message: Message, _): 30 | playmode = await get_playmode(message.chat.id) 31 | Direct = True if playmode == "Direct" else None 32 | is_non_admin = await is_nonadmin_chat(message.chat.id) 33 | Group = None if is_non_admin else True 34 | playty = await get_playtype(message.chat.id) 35 | Playtype = None if playty == "Everyone" else True 36 | buttons = playmode_users_markup(_, Direct, Group, Playtype) 37 | response = await message.reply_text( 38 | _["playmode_1"].format(message.chat.title), 39 | reply_markup=InlineKeyboardMarkup(buttons), 40 | ) 41 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/play/stream.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from pyrogram import filters 13 | from pyrogram.types import Message 14 | from pytgcalls.exceptions import NoActiveGroupCall 15 | 16 | import config 17 | from config import BANNED_USERS 18 | from strings import get_command 19 | from AlexaMusic import app 20 | from AlexaMusic.core.call import Alexa 21 | from AlexaMusic.utils.decorators.play import PlayWrapper 22 | from AlexaMusic.utils.logger import play_logs 23 | from AlexaMusic.utils.stream.stream import stream 24 | 25 | # Command 26 | STREAM_COMMAND = get_command("STREAM_COMMAND") 27 | 28 | 29 | @app.on_message(filters.command(STREAM_COMMAND) & filters.group & ~BANNED_USERS) 30 | @PlayWrapper 31 | async def stream_command( 32 | client, 33 | message: Message, 34 | _, 35 | chat_id, 36 | video, 37 | channel, 38 | playmode, 39 | url, 40 | fplay, 41 | ): 42 | if url: 43 | mystic = await message.reply_text( 44 | _["play_2"].format(channel) if channel else _["play_1"] 45 | ) 46 | try: 47 | await Alexa.stream_call(url) 48 | except NoActiveGroupCall: 49 | await mystic.edit_text( 50 | "ᴛʜᴇʀᴇ's ᴀɴ ɪssᴜᴇ ᴡɪᴛʜ ᴛʜᴇ ʙᴏᴛ. ᴘʟᴇᴀsᴇ ʀᴇᴘᴏʀᴛ ɪᴛ ᴛᴏ ᴍʏ ᴏᴡɴᴇʀ ᴀɴᴅ ᴀsᴋ ᴛʜᴇᴍ ᴛᴏ ᴄʜᴇᴄᴋ ʟᴏɢɢᴇʀ ɢʀᴏᴜᴘ." 51 | ) 52 | return await app.send_message( 53 | config.LOG_GROUP_ID, 54 | "ᴘʟᴇᴀsᴇ ᴛᴜʀɴ ᴏɴ ᴠᴏɪᴄᴇ ᴄʜᴀᴛ.. ʙᴏᴛ ɪs ɴᴏᴛ ᴀʙʟᴇ ᴛᴏ sᴛʀᴇᴀᴍ ᴜʀʟs..", 55 | ) 56 | except Exception as e: 57 | return await mystic.edit_text(_["general_3"].format(type(e).__name__)) 58 | await mystic.edit_text(_["str_2"]) 59 | try: 60 | await stream( 61 | _, 62 | mystic, 63 | message.from_user.id, 64 | url, 65 | chat_id, 66 | message.from_user.first_name, 67 | message.chat.id, 68 | video=True, 69 | streamtype="index", 70 | ) 71 | except Exception as e: 72 | ex_type = type(e).__name__ 73 | err = e if ex_type == "AssistantErr" else _["general_3"].format(ex_type) 74 | return await mystic.edit_text(err) 75 | return await play_logs(message, streamtype="M3u8 or Index Link") 76 | else: 77 | await message.reply_text(_["str_1"]) 78 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/play/toptracks.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import asyncio 13 | 14 | from pyrogram import filters 15 | from pyrogram.types import InlineKeyboardMarkup 16 | 17 | from AlexaMusic import app 18 | from AlexaMusic.utils.database import get_global_tops, get_particulars, get_userss 19 | from AlexaMusic.utils.decorators.language import languageCB 20 | from AlexaMusic.utils.inline.playlist import ( 21 | botplaylist_markup, 22 | failed_top_markup, 23 | top_play_markup, 24 | ) 25 | from AlexaMusic.utils.stream.stream import stream 26 | from config import BANNED_USERS 27 | 28 | loop = asyncio.get_running_loop() 29 | 30 | 31 | @app.on_callback_query(filters.regex("get_playmarkup") & ~BANNED_USERS) 32 | @languageCB 33 | async def get_play_markup(client, CallbackQuery, _): 34 | try: 35 | await CallbackQuery.answer() 36 | except Exception: 37 | pass 38 | buttons = botplaylist_markup(_) 39 | return await CallbackQuery.edit_message_reply_markup( 40 | reply_markup=InlineKeyboardMarkup(buttons) 41 | ) 42 | 43 | 44 | @app.on_callback_query(filters.regex("get_top_playlists") & ~BANNED_USERS) 45 | @languageCB 46 | async def get_topz_playlists(client, CallbackQuery, _): 47 | try: 48 | await CallbackQuery.answer() 49 | except Exception: 50 | pass 51 | buttons = top_play_markup(_) 52 | return await CallbackQuery.edit_message_reply_markup( 53 | reply_markup=InlineKeyboardMarkup(buttons) 54 | ) 55 | 56 | 57 | @app.on_callback_query(filters.regex("SERVERTOP") & ~BANNED_USERS) 58 | @languageCB 59 | async def server_to_play(client, CallbackQuery, _): 60 | chat_id = CallbackQuery.message.chat.id 61 | user_name = CallbackQuery.from_user.first_name 62 | try: 63 | await CallbackQuery.answer() 64 | except Exception: 65 | pass 66 | callback_data = CallbackQuery.data.strip() 67 | what = callback_data.split(None, 1)[1] 68 | mystic = await CallbackQuery.edit_message_text( 69 | _["tracks_1"].format( 70 | what, 71 | CallbackQuery.from_user.first_name, 72 | ) 73 | ) 74 | upl = failed_top_markup(_) 75 | if what == "Global": 76 | stats = await get_global_tops() 77 | elif what == "Group": 78 | stats = await get_particulars(chat_id) 79 | elif what == "Personal": 80 | stats = await get_userss(CallbackQuery.from_user.id) 81 | if not stats: 82 | return await mystic.edit(_["tracks_2"].format(what), reply_markup=upl) 83 | 84 | def get_stats(): 85 | results = {} 86 | for i in stats: 87 | top_list = stats[i]["spot"] 88 | results[str(i)] = top_list 89 | list_arranged = dict( 90 | sorted( 91 | results.items(), 92 | key=lambda item: item[1], 93 | reverse=True, 94 | ) 95 | ) 96 | if not results: 97 | return mystic.edit(_["tracks_2"].format(what), reply_markup=upl) 98 | details = [] 99 | limit = 0 100 | for vidid, count in list_arranged.items(): 101 | if vidid == "telegram": 102 | continue 103 | if limit == 10: 104 | break 105 | limit += 1 106 | details.append(vidid) 107 | if not details: 108 | return mystic.edit(_["tracks_2"].format(what), reply_markup=upl) 109 | return details 110 | 111 | try: 112 | details = await loop.run_in_executor(None, get_stats) 113 | except Exception as e: 114 | print(e) 115 | return 116 | try: 117 | await stream( 118 | _, 119 | mystic, 120 | CallbackQuery.from_user.id, 121 | details, 122 | chat_id, 123 | user_name, 124 | CallbackQuery.message.chat.id, 125 | video=False, 126 | streamtype="playlist", 127 | ) 128 | except Exception as e: 129 | ex_type = type(e).__name__ 130 | err = e if ex_type == "AssistantErr" else _["general_3"].format(ex_type) 131 | return await mystic.edit_text(err) 132 | return await mystic.delete() 133 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/autoend.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | 15 | import config 16 | from strings import get_command 17 | from AlexaMusic import app 18 | from AlexaMusic.misc import SUDOERS 19 | from AlexaMusic.utils.database import autoend_off, autoend_on 20 | from AlexaMusic.utils.decorators.language import language 21 | 22 | # Commands 23 | AUTOEND_COMMAND = get_command("AUTOEND_COMMAND") 24 | 25 | 26 | @app.on_message(filters.command(AUTOEND_COMMAND) & SUDOERS) 27 | async def auto_end_stream(client, message): 28 | usage = "**ᴜsᴀɢᴇ:**\n\n/autoend [enable|disable]" 29 | if len(message.command) != 2: 30 | return await message.reply_text(usage) 31 | state = message.text.split(None, 1)[1].strip() 32 | state = state.lower() 33 | if state == "enable": 34 | await autoend_on() 35 | await message.reply_text( 36 | "ᴀᴜᴛᴏ ᴇɴᴅ sᴛʀᴇᴀᴍ ᴇɴᴀʙʟᴇᴅ.\n\nᴀssɪsᴛᴀɴᴛ ᴡɪʟʟ ᴀᴜᴛᴏᴍᴀᴛɪᴄᴀʟʟʏ ʟᴇᴀᴠᴇ ᴛʜᴇ ᴠɪᴅᴇᴏᴄʜᴀᴛ ᴀғᴛᴇʀ ғᴇᴡ ᴍɪɴs ᴡʜᴇɴ ɴᴏ ᴏɴᴇ ɪs ʟɪsᴛᴇɴɪɴɢ ᴡɪᴛʜ ᴀ ᴡᴀʀɴɪɴɢ ᴍᴇssᴀɢᴇ." 37 | ) 38 | elif state == "disable": 39 | await autoend_off() 40 | await message.reply_text("ᴀᴜᴛᴏ ᴇɴᴅ sᴛʀᴇᴀᴍ ᴅɪsᴀʙʟᴇᴅ.") 41 | else: 42 | await message.reply_text(usage) 43 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/blacklistchat.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.misc import SUDOERS 20 | from AlexaMusic.utils.database import blacklist_chat, blacklisted_chats, whitelist_chat 21 | from AlexaMusic.utils.decorators.language import language 22 | 23 | # Commands 24 | 25 | BLACKLISTCHAT_COMMAND = get_command("BLACKLISTCHAT_COMMAND") 26 | WHITELISTCHAT_COMMAND = get_command("WHITELISTCHAT_COMMAND") 27 | BLACKLISTEDCHAT_COMMAND = get_command("BLACKLISTEDCHAT_COMMAND") 28 | 29 | 30 | @app.on_message(filters.command(BLACKLISTCHAT_COMMAND) & SUDOERS) 31 | @language 32 | async def blacklist_chat_func(client, message: Message, _): 33 | if len(message.command) != 2: 34 | return await message.reply_text(_["black_1"]) 35 | chat_id = int(message.text.strip().split()[1]) 36 | if chat_id in await blacklisted_chats(): 37 | return await message.reply_text(_["black_2"]) 38 | blacklisted = await blacklist_chat(chat_id) 39 | if blacklisted: 40 | await message.reply_text(_["black_3"]) 41 | else: 42 | await message.reply_text("sᴏᴍᴇᴛʜɪɴɢ ᴡᴇɴᴛ ᴡʀᴏɴɢ.") 43 | try: 44 | await app.leave_chat(chat_id) 45 | except: 46 | pass 47 | 48 | 49 | @app.on_message(filters.command(WHITELISTCHAT_COMMAND) & SUDOERS) 50 | @language 51 | async def white_funciton(client, message: Message, _): 52 | if len(message.command) != 2: 53 | return await message.reply_text(_["black_4"]) 54 | chat_id = int(message.text.strip().split()[1]) 55 | if chat_id not in await blacklisted_chats(): 56 | return await message.reply_text(_["black_5"]) 57 | whitelisted = await whitelist_chat(chat_id) 58 | if whitelisted: 59 | return await message.reply_text(_["black_6"]) 60 | await message.reply_text("sᴏᴍᴇᴛʜɪɴɢ ᴡᴇɴᴛ ᴡʀᴏɴɢ.") 61 | 62 | 63 | @app.on_message(filters.command(BLACKLISTEDCHAT_COMMAND) & ~BANNED_USERS) 64 | @language 65 | async def all_chats(client, message: Message, _): 66 | text = _["black_7"] 67 | j = 0 68 | for count, chat_id in enumerate(await blacklisted_chats(), 1): 69 | try: 70 | title = (await app.get_chat(chat_id)).title 71 | except Exception: 72 | title = "ᴩʀɪᴠᴀᴛᴇ ᴄʜᴀᴛ" 73 | j = 1 74 | text += f"**{count}. {title}** [`{chat_id}`]\n" 75 | if j == 0: 76 | await message.reply_text(_["black_8"]) 77 | else: 78 | await message.reply_text(text) 79 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/block.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.misc import SUDOERS 20 | from AlexaMusic.utils.database import add_gban_user, remove_gban_user 21 | from AlexaMusic.utils.decorators.language import language 22 | 23 | # Command 24 | BLOCK_COMMAND = get_command("BLOCK_COMMAND") 25 | UNBLOCK_COMMAND = get_command("UNBLOCK_COMMAND") 26 | BLOCKED_COMMAND = get_command("BLOCKED_COMMAND") 27 | 28 | 29 | @app.on_message(filters.command(BLOCK_COMMAND) & SUDOERS) 30 | @language 31 | async def useradd(client, message: Message, _): 32 | if not message.reply_to_message: 33 | if len(message.command) != 2: 34 | return await message.reply_text(_["general_1"]) 35 | user = message.text.split(None, 1)[1] 36 | if "@" in user: 37 | user = user.replace("@", "") 38 | user = await app.get_users(user) 39 | if user.id in BANNED_USERS: 40 | return await message.reply_text(_["block_1"].format(user.mention)) 41 | await add_gban_user(user.id) 42 | BANNED_USERS.add(user.id) 43 | await message.reply_text(_["block_2"].format(user.mention)) 44 | return 45 | if message.reply_to_message.from_user.id in BANNED_USERS: 46 | return await message.reply_text( 47 | _["block_1"].format(message.reply_to_message.from_user.mention) 48 | ) 49 | await add_gban_user(message.reply_to_message.from_user.id) 50 | BANNED_USERS.add(message.reply_to_message.from_user.id) 51 | await message.reply_text( 52 | _["block_2"].format(message.reply_to_message.from_user.mention) 53 | ) 54 | 55 | 56 | @app.on_message(filters.command(UNBLOCK_COMMAND) & SUDOERS) 57 | @language 58 | async def userdel(client, message: Message, _): 59 | if not message.reply_to_message: 60 | if len(message.command) != 2: 61 | return await message.reply_text(_["general_1"]) 62 | user = message.text.split(None, 1)[1] 63 | if "@" in user: 64 | user = user.replace("@", "") 65 | user = await app.get_users(user) 66 | if user.id not in BANNED_USERS: 67 | return await message.reply_text(_["block_3"]) 68 | await remove_gban_user(user.id) 69 | BANNED_USERS.remove(user.id) 70 | await message.reply_text(_["block_4"]) 71 | return 72 | user_id = message.reply_to_message.from_user.id 73 | if user_id not in BANNED_USERS: 74 | return await message.reply_text(_["block_3"]) 75 | await remove_gban_user(user_id) 76 | BANNED_USERS.remove(user_id) 77 | await message.reply_text(_["block_4"]) 78 | 79 | 80 | @app.on_message(filters.command(BLOCKED_COMMAND) & SUDOERS) 81 | @language 82 | async def sudoers_list(client, message: Message, _): 83 | if not BANNED_USERS: 84 | return await message.reply_text(_["block_5"]) 85 | mystic = await message.reply_text(_["block_6"]) 86 | msg = _["block_7"] 87 | count = 0 88 | for users in BANNED_USERS: 89 | try: 90 | user = await app.get_users(users) 91 | user = user.mention or user.first_name 92 | count += 1 93 | except Exception: 94 | continue 95 | msg += f"{count}➤ {user}\n" 96 | if count == 0: 97 | return await mystic.edit_text(_["block_5"]) 98 | else: 99 | return await mystic.edit_text(msg) 100 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | 15 | import config 16 | from strings import get_command 17 | from AlexaMusic import app 18 | from AlexaMusic.misc import SUDOERS 19 | from AlexaMusic.utils.database import add_off, add_on 20 | from AlexaMusic.utils.decorators.language import language 21 | 22 | # Commands 23 | LOGGER_COMMAND = get_command("LOGGER_COMMAND") 24 | 25 | 26 | @app.on_message(filters.command(LOGGER_COMMAND) & SUDOERS) 27 | @language 28 | async def logger(client, message, _): 29 | usage = _["log_1"] 30 | if len(message.command) != 2: 31 | return await message.reply_text(usage) 32 | state = message.text.split(None, 1)[1].strip() 33 | state = state.lower() 34 | if state == "enable": 35 | await add_on(config.LOG) 36 | await message.reply_text(_["log_2"]) 37 | elif state == "disable": 38 | await add_off(config.LOG) 39 | await message.reply_text(_["log_3"]) 40 | else: 41 | await message.reply_text(usage) 42 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/maintenance.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from strings import get_command, get_string 17 | from AlexaMusic import app 18 | from AlexaMusic.misc import SUDOERS 19 | from AlexaMusic.utils.database import ( 20 | get_lang, 21 | is_maintenance, 22 | maintenance_off, 23 | maintenance_on, 24 | ) 25 | from AlexaMusic.utils.decorators.language import language 26 | 27 | # Commands 28 | MAINTENANCE_COMMAND = get_command("MAINTENANCE_COMMAND") 29 | 30 | 31 | @app.on_message(filters.command(MAINTENANCE_COMMAND) & SUDOERS) 32 | async def maintenance(client, message: Message): 33 | try: 34 | language = await get_lang(message.chat.id) 35 | _ = get_string(language) 36 | except Exception: 37 | _ = get_string("en") 38 | usage = _["maint_1"] 39 | if len(message.command) != 2: 40 | return await message.reply_text(usage) 41 | message.chat.id 42 | state = message.text.split(None, 1)[1].strip() 43 | state = state.lower() 44 | if state == "enable": 45 | if await is_maintenance() is False: 46 | await message.reply_text("ᴍᴀɪɴᴛᴇɴᴀɴᴄᴇ ᴍᴏᴅᴇ ɪs ᴀʟʀᴇᴀᴅʏ ᴇɴᴀʙʟᴇᴅ.") 47 | else: 48 | await maintenance_on() 49 | await message.reply_text(_["maint_2"]) 50 | elif state == "disable": 51 | if await is_maintenance() is False: 52 | await maintenance_off() 53 | await message.reply_text(_["maint_3"]) 54 | else: 55 | await message.reply_text( 56 | "ɪ ᴅᴏɴ'ᴛ ʀᴇᴍᴇᴍʙᴇʀ ᴛʜᴀᴛ ʏᴏᴜ ᴇɴᴀʙʟᴇᴅ ᴍᴀɪɴᴛᴇɴᴀɴᴄᴇ ᴍᴏᴅᴇ." 57 | ) 58 | else: 59 | await message.reply_text(usage) 60 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/private.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | import config 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.misc import SUDOERS 20 | from AlexaMusic.utils.database import ( 21 | add_private_chat, 22 | get_private_served_chats, 23 | is_served_private_chat, 24 | remove_private_chat, 25 | ) 26 | from AlexaMusic.utils.decorators.language import language 27 | 28 | AUTHORIZE_COMMAND = get_command("AUTHORIZE_COMMAND") 29 | UNAUTHORIZE_COMMAND = get_command("UNAUTHORIZE_COMMAND") 30 | AUTHORIZED_COMMAND = get_command("AUTHORIZED_COMMAND") 31 | 32 | 33 | @app.on_message(filters.command(AUTHORIZE_COMMAND) & SUDOERS) 34 | @language 35 | async def authorize(client, message: Message, _): 36 | if config.PRIVATE_BOT_MODE != str(True): 37 | return await message.reply_text(_["pbot_12"]) 38 | if len(message.command) != 2: 39 | return await message.reply_text(_["pbot_1"]) 40 | try: 41 | chat_id = int(message.text.strip().split()[1]) 42 | except Exception: 43 | return await message.reply_text(_["pbot_7"]) 44 | if not await is_served_private_chat(chat_id): 45 | await add_private_chat(chat_id) 46 | await message.reply_text(_["pbot_3"]) 47 | else: 48 | await message.reply_text(_["pbot_5"]) 49 | 50 | 51 | @app.on_message(filters.command(UNAUTHORIZE_COMMAND) & SUDOERS) 52 | @language 53 | async def unauthorize(client, message: Message, _): 54 | if config.PRIVATE_BOT_MODE != str(True): 55 | return await message.reply_text(_["pbot_12"]) 56 | if len(message.command) != 2: 57 | return await message.reply_text(_["pbot_2"]) 58 | try: 59 | chat_id = int(message.text.strip().split()[1]) 60 | except Exception: 61 | return await message.reply_text(_["pbot_7"]) 62 | if not await is_served_private_chat(chat_id): 63 | return await message.reply_text(_["pbot_6"]) 64 | await remove_private_chat(chat_id) 65 | return await message.reply_text(_["pbot_4"]) 66 | 67 | 68 | @app.on_message(filters.command(AUTHORIZED_COMMAND) & SUDOERS) 69 | @language 70 | async def authorized(client, message: Message, _): 71 | if config.PRIVATE_BOT_MODE != str(True): 72 | return await message.reply_text(_["pbot_12"]) 73 | m = await message.reply_text(_["pbot_8"]) 74 | text = _["pbot_9"] 75 | chats = await get_private_served_chats() 76 | served_chats = [int(chat["chat_id"]) for chat in chats] 77 | count = 0 78 | co = 0 79 | msg = _["pbot_13"] 80 | for served_chat in served_chats: 81 | try: 82 | title = (await app.get_chat(served_chat)).title 83 | count += 1 84 | text += f"{count}:- {title[:15]} [{served_chat}]\n" 85 | except Exception: 86 | title = _["pbot_10"] 87 | co += 1 88 | msg += f"{co}:- {title} [{served_chat}]\n" 89 | if co == 0: 90 | return await m.edit(_["pbot_11"]) if count == 0 else await m.edit(text) 91 | if count == 0: 92 | await m.edit(msg) 93 | else: 94 | text = f"{text} {msg}" 95 | return await m.edit(text) 96 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/sudoers.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from config import BANNED_USERS, MONGO_DB_URI, OWNER_ID, MUSIC_BOT_NAME 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.misc import SUDOERS 20 | from AlexaMusic.utils.database import add_sudo, remove_sudo 21 | from AlexaMusic.utils.decorators.language import language 22 | 23 | # Command 24 | ADDSUDO_COMMAND = get_command("ADDSUDO_COMMAND") 25 | DELSUDO_COMMAND = get_command("DELSUDO_COMMAND") 26 | SUDOUSERS_COMMAND = get_command("SUDOUSERS_COMMAND") 27 | 28 | 29 | @app.on_message(filters.command(ADDSUDO_COMMAND) & filters.user(OWNER_ID)) 30 | @language 31 | async def useradd(client, message: Message, _): 32 | if MONGO_DB_URI is None: 33 | return await message.reply_text( 34 | "**ᴅᴜᴇ ᴛᴏ {MUSIC_BOT_NAME}'s ᴩʀɪᴠᴀᴄʏ ɪssᴜᴇs, ʏᴏᴜ ᴄᴀɴ'ᴛ ᴍᴀɴᴀɢᴇ sᴜᴅᴏ ᴜsᴇʀs ᴏɴ {MUSIC_BOT_NAME} ᴅᴀᴛᴀʙᴀsᴇ.\n\n ᴩʟᴇᴀsᴇ ᴀᴅᴅ ʏᴏᴜʀ ᴍᴏɴɢᴏ ᴅᴀᴛᴀʙᴀsᴇ ɪɴ ᴠᴀʀs ᴛᴏ ᴜsᴇ ᴛʜɪs ғᴇᴀᴛᴜʀᴇ.**" 35 | ) 36 | if not message.reply_to_message: 37 | if len(message.command) != 2: 38 | return await message.reply_text(_["auth_1"]) 39 | user = message.text.split(None, 1)[1] 40 | if "@" in user: 41 | user = user.replace("@", "") 42 | user = await app.get_users(user) 43 | if user.id in SUDOERS: 44 | return await message.reply_text(_["sudo_1"].format(user.mention)) 45 | added = await add_sudo(user.id) 46 | if added: 47 | SUDOERS.add(user.id) 48 | await message.reply_text(_["sudo_2"].format(user.mention)) 49 | else: 50 | await message.reply_text("ғᴀɪʟᴇᴅ.") 51 | return 52 | if message.reply_to_message.from_user.id in SUDOERS: 53 | return await message.reply_text( 54 | _["sudo_1"].format(message.reply_to_message.from_user.mention) 55 | ) 56 | added = await add_sudo(message.reply_to_message.from_user.id) 57 | if added: 58 | SUDOERS.add(message.reply_to_message.from_user.id) 59 | await message.reply_text( 60 | _["sudo_2"].format(message.reply_to_message.from_user.mention) 61 | ) 62 | else: 63 | await message.reply_text("ғᴀɪʟᴇᴅ.") 64 | return 65 | 66 | 67 | @app.on_message(filters.command(DELSUDO_COMMAND) & filters.user(OWNER_ID)) 68 | @language 69 | async def userdel(client, message: Message, _): 70 | if MONGO_DB_URI is None: 71 | return await message.reply_text( 72 | "**ᴅᴜᴇ ᴛᴏ {MUSIC_BOT_NAME}'s ᴩʀɪᴠᴀᴄʏ ɪssᴜᴇs, ʏᴏᴜ ᴄᴀɴ'ᴛ ᴍᴀɴᴀɢᴇ sᴜᴅᴏ ᴜsᴇʀs ᴏɴ {MUSIC_BOT_NAME} ᴅᴀᴛᴀʙᴀsᴇ.\n\n ᴩʟᴇᴀsᴇ ᴀᴅᴅ ʏᴏᴜʀ ᴍᴏɴɢᴏ ᴅᴀᴛᴀʙᴀsᴇ ɪɴ ᴠᴀʀs ᴛᴏ ᴜsᴇ ᴛʜɪs ғᴇᴀᴛᴜʀᴇ.**" 73 | ) 74 | if not message.reply_to_message: 75 | if len(message.command) != 2: 76 | return await message.reply_text(_["auth_1"]) 77 | user = message.text.split(None, 1)[1] 78 | if "@" in user: 79 | user = user.replace("@", "") 80 | user = await app.get_users(user) 81 | if user.id not in SUDOERS: 82 | return await message.reply_text(_["sudo_3"]) 83 | removed = await remove_sudo(user.id) 84 | if removed: 85 | SUDOERS.remove(user.id) 86 | await message.reply_text(_["sudo_4"]) 87 | return 88 | await message.reply_text("Something wrong happened.") 89 | return 90 | user_id = message.reply_to_message.from_user.id 91 | if user_id not in SUDOERS: 92 | return await message.reply_text(_["sudo_3"]) 93 | removed = await remove_sudo(user_id) 94 | if removed: 95 | SUDOERS.remove(user_id) 96 | await message.reply_text(_["sudo_4"]) 97 | return 98 | await message.reply_text("sᴏᴍᴇᴛʜɪɴɢ ᴡᴇɴᴛ ᴡʀᴏɴɢ.") 99 | 100 | 101 | @app.on_message(filters.command(SUDOUSERS_COMMAND) & ~BANNED_USERS) 102 | @language 103 | async def sudoers_list(client, message: Message, _): 104 | text = _["sudo_5"] 105 | user = await app.get_users(OWNER_ID) 106 | user = user.mention or user.first_name 107 | text += f"1➤ {user}\n" 108 | count = 0 109 | smex = 0 110 | for user_id in SUDOERS: 111 | if user_id not in OWNER_ID: 112 | try: 113 | user = await app.get_users(user_id) 114 | user = user.mention or user.first_name 115 | if smex == 0: 116 | smex += 1 117 | text += _["sudo_6"] 118 | count += 1 119 | text += f"{count}➤ {user}\n" 120 | except Exception: 121 | continue 122 | if not text: 123 | await message.reply_text(_["sudo_7"]) 124 | else: 125 | await message.reply_text(text) 126 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/vars.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | 15 | from pyrogram import filters 16 | 17 | import config 18 | from strings import get_command 19 | from AlexaMusic import app 20 | from AlexaMusic.misc import SUDOERS 21 | from AlexaMusic.utils.database.memorydatabase import get_video_limit 22 | from AlexaMusic.utils.formatters import convert_bytes 23 | 24 | VARS_COMMAND = get_command("VARS_COMMAND") 25 | 26 | 27 | @app.on_message(filters.command(VARS_COMMAND) & SUDOERS) 28 | async def varsFunc(client, message): 29 | mystic = await message.reply_text("ᴩʟᴇᴀsᴇ ᴡᴀɪᴛ... ɢᴇᴛᴛɪɴɢ ʏᴏᴜʀ ᴄᴏɴғɪɢ ᴠᴀʀɪᴀʙʟᴇs...") 30 | v_limit = await get_video_limit() 31 | bot_name = config.MUSIC_BOT_NAME 32 | up_r = f"[ʀᴇᴩᴏ]({config.UPSTREAM_REPO})" 33 | up_b = config.UPSTREAM_BRANCH 34 | auto_leave = config.AUTO_LEAVE_ASSISTANT_TIME 35 | yt_sleep = config.YOUTUBE_DOWNLOAD_EDIT_SLEEP 36 | tg_sleep = config.TELEGRAM_DOWNLOAD_EDIT_SLEEP 37 | playlist_limit = config.SERVER_PLAYLIST_LIMIT 38 | fetch_playlist = config.PLAYLIST_FETCH_LIMIT 39 | song = config.SONG_DOWNLOAD_DURATION 40 | play_duration = config.DURATION_LIMIT_MIN 41 | cm = config.CLEANMODE_DELETE_MINS 42 | auto_sug = config.AUTO_SUGGESTION_TIME 43 | ass = "ʏᴇs" if config.AUTO_LEAVING_ASSISTANT == str(True) else "ɴᴏ" 44 | pvt = "ʏᴇs" if config.PRIVATE_BOT_MODE == str(True) else "ɴᴏ" 45 | a_sug = "ʏᴇs" if config.AUTO_SUGGESTION_MODE == str(True) else "ɴᴏ" 46 | down = "ʏᴇs" if config.AUTO_DOWNLOADS_CLEAR == str(True) else "ɴᴏ" 47 | git = f"[ʀᴇᴩᴏ]({config.GITHUB_REPO})" if config.GITHUB_REPO else "ɴᴏ" 48 | if not config.START_IMG_URL: 49 | start = "ɴᴏ" 50 | else: 51 | start = f"[ɪᴍᴀɢᴇ]({config.START_IMG_URL})" 52 | if not config.SUPPORT_CHANNEL: 53 | s_c = "ɴᴏ" 54 | else: 55 | s_c = f"[ᴄʜᴀɴɴᴇʟ]({config.SUPPORT_CHANNEL})" 56 | if not config.SUPPORT_GROUP: 57 | s_g = "ɴᴏ" 58 | else: 59 | s_g = f"[sᴜᴩᴩᴏʀᴛ]({config.SUPPORT_GROUP})" 60 | if not config.GIT_TOKEN: 61 | token = "ɴᴏ" 62 | else: 63 | token = "ʏᴇs" 64 | if not config.SPOTIFY_CLIENT_ID and not config.SPOTIFY_CLIENT_SECRET: 65 | sotify = "ɴᴏ" 66 | else: 67 | sotify = "ʏᴇs" 68 | owners = [str(ids) for ids in config.OWNER_ID] 69 | owner_id = " ,".join(owners) 70 | tg_aud = convert_bytes(config.TG_AUDIO_FILESIZE_LIMIT) 71 | tg_vid = convert_bytes(config.TG_VIDEO_FILESIZE_LIMIT) 72 | text = f"""**ᴍᴜsɪᴄ ʙᴏᴛ ᴄᴏɴғɪɢ ᴠᴀʀɪᴀʙʟᴇs:** 73 | 74 | **ʙᴀsɪᴄ ᴠᴀʀɪᴀʙʟᴇs:** 75 | **ᴍᴜsɪᴄ_ʙᴏᴛ_ɴᴀᴍᴇ** : `{bot_name}` 76 | **ᴅᴜʀᴀᴛɪᴏɴ_ʟɪᴍɪᴛ** : `{play_duration} ᴍɪɴᴜᴛᴇs` 77 | **sᴏɴɢ_ᴅᴏᴡɴʟᴏᴀᴅ_ᴅᴜʀᴀᴛɪᴏɴ_ʟɪᴍɪᴛ** :` {song} ᴍɪɴᴜᴛᴇs` 78 | **ᴏᴡɴᴇʀ_ɪᴅ** : `{owner_id}` 79 | 80 | **ʀᴇᴩᴏsɪᴛᴏʀʏ ᴠᴀʀɪᴀʙʟᴇs:** 81 | **ᴜᴩsᴛʀᴇᴀᴍ_ʀᴇᴩᴏ** : `{up_r}` 82 | **ᴜᴩsᴛʀᴇᴀᴍ_ʙʀᴀɴᴄʜ** : `{up_b}` 83 | **ɢɪᴛʜᴜʙ_ʀᴇᴩᴏ** :` {git}` 84 | **ɢɪᴛ_ᴛᴏᴋᴇɴ**:` {token}` 85 | 86 | 87 | **ʙᴏᴛ ᴠᴀʀɪᴀʙʟᴇs:** 88 | **ᴀᴜᴛᴏ_ʟᴇᴀᴠɪɴɢ_ᴀssɪsᴛᴀɴᴛ** : `{ass}` 89 | **ᴀssɪsᴛᴀɴᴛ_ʟᴇᴀᴠᴇ_ᴛɪᴍᴇ** : `{auto_leave} sᴇᴄᴏɴᴅs` 90 | **ᴀᴜᴛᴏ_sᴜɢɢᴇsᴛɪᴏɴ_ᴍᴏᴅᴇ** :` {a_sug}` 91 | **ᴀᴜᴛᴏ_sᴜɢɢᴇsᴛɪᴏɴ_ᴛɪᴍᴇ** : `{auto_sug} sᴇᴄᴏɴᴅs` 92 | **ᴀᴜᴛᴏ_ᴅᴏᴡɴʟᴏᴀᴅs_ᴄʟᴇᴀʀ** : `{down}` 93 | **ᴩʀɪᴠᴀᴛᴇ_ʙᴏᴛ_ᴍᴏᴅᴇ** : `{pvt}` 94 | **ʏᴏᴜᴛᴜʙᴇ_ᴇᴅɪᴛ_sʟᴇᴇᴩ** : `{yt_sleep} sᴇᴄᴏɴᴅs` 95 | **ᴛᴇʟᴇɢʀᴀᴍ_ᴇᴅɪᴛ_sʟᴇᴇᴩ** :` {tg_sleep} sᴇᴄᴏɴᴅs` 96 | **ᴄʟᴇᴀɴᴍᴏᴅᴇ_ᴍɪɴs** : `{cm} ᴍɪɴᴜᴛᴇs` 97 | **ᴠɪᴅᴇᴏ_sᴛʀᴇᴀᴍ_ʟɪᴍɪᴛ** : `{v_limit} ᴄʜᴀᴛs` 98 | **sᴇʀᴠᴇʀ_ᴩʟᴀʏʟɪsᴛ_ʟɪᴍɪᴛ** :` {playlist_limit}` 99 | **ᴩʟᴀʏʟɪsᴛ_ғᴇᴛᴄʜ_ʟɪᴍɪᴛ** :` {fetch_playlist}` 100 | 101 | **sᴩᴏᴛɪғʏ ᴠᴀʀɪᴀʙʟᴇs:** 102 | **sᴩᴏᴛɪғʏ_ᴄʟɪᴇɴᴛ_ɪᴅ** :` {sotify}` 103 | **sᴩᴏᴛɪғʏ_ᴄʟɪᴇɴᴛ_sᴇᴄʀᴇᴛ** : `{sotify}` 104 | 105 | **Playsize Vars:** 106 | **ᴛɢ_ᴀᴜᴅɪᴏ_ғʟɪᴇsɪᴢᴇ_ʟɪᴍɪᴛ** :` {tg_aud}` 107 | **ᴛɢ_ᴠɪᴅᴇᴏ_ғɪʟᴇsɪᴢᴇ_ʟɪᴍɪᴛ** :` {tg_vid}` 108 | 109 | **ᴇxᴛʀᴀ ᴠᴀʀɪᴀʙʟᴇs:** 110 | **sᴜᴩᴩᴏʀᴛ_ᴄʜᴀɴɴᴇʟ** : `{s_c}` 111 | **sᴜᴩᴩᴏʀᴛ_ɢʀᴏᴜᴩ** : ` {s_g}` 112 | **sᴛᴀʀᴛ_ɪᴍɢ_ᴜʀʟ** : ` {start}` 113 | """ 114 | await asyncio.sleep(1) 115 | await mystic.edit_text(text) 116 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/videolimit.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | 16 | from strings import get_command 17 | from AlexaMusic import app 18 | from AlexaMusic.misc import SUDOERS 19 | from AlexaMusic.utils.database import set_video_limit 20 | from AlexaMusic.utils.decorators.language import language 21 | 22 | VIDEOLIMIT_COMMAND = get_command("VIDEOLIMIT_COMMAND") 23 | 24 | 25 | @app.on_message(filters.command(VIDEOLIMIT_COMMAND) & SUDOERS) 26 | @language 27 | async def set_video_limit_kid(client, message: Message, _): 28 | if len(message.command) != 2: 29 | usage = _["vid_1"] 30 | return await message.reply_text(usage) 31 | message.chat.id 32 | state = message.text.split(None, 1)[1].strip() 33 | if state.lower() == "disable": 34 | limit = 0 35 | await set_video_limit(limit) 36 | return await message.reply_text(_["vid_4"]) 37 | if state.isnumeric(): 38 | limit = int(state) 39 | await set_video_limit(limit) 40 | if limit == 0: 41 | return await message.reply_text(_["vid_4"]) 42 | await message.reply_text(_["vid_3"].format(limit)) 43 | else: 44 | return await message.reply_text(_["vid_2"]) 45 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/sudo/videomode.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from pyrogram import filters 13 | from pyrogram.types import Message 14 | 15 | import config 16 | from strings import get_command 17 | from AlexaMusic import app 18 | from AlexaMusic.misc import SUDOERS 19 | from AlexaMusic.utils.database import add_off, add_on 20 | from AlexaMusic.utils.decorators.language import language 21 | 22 | # Commands 23 | VIDEOMODE_COMMAND = get_command("VIDEOMODE_COMMAND") 24 | 25 | 26 | @app.on_message(filters.command(VIDEOMODE_COMMAND) & SUDOERS) 27 | @language 28 | async def videoloaymode(client, message: Message, _): 29 | usage = _["vidmode_1"] 30 | if len(message.command) != 2: 31 | return await message.reply_text(usage) 32 | state = message.text.split(None, 1)[1].strip() 33 | state = state.lower() 34 | if state == "download": 35 | await add_on(config.YTDOWNLOADER) 36 | await message.reply_text(_["vidmode_2"]) 37 | elif state == "m3u8": 38 | await add_off(config.YTDOWNLOADER) 39 | await message.reply_text(_["vidmode_3"]) 40 | else: 41 | await message.reply_text(usage) 42 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/tools/active.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram import filters 14 | from pyrogram.types import Message 15 | from unidecode import unidecode 16 | 17 | from strings import get_command 18 | from AlexaMusic import app 19 | from AlexaMusic.misc import SUDOERS, db 20 | from AlexaMusic.utils.database.memorydatabase import ( 21 | get_active_chats, 22 | get_active_video_chats, 23 | remove_active_chat, 24 | remove_active_video_chat, 25 | ) 26 | 27 | # Commands 28 | ACTIVEVC_COMMAND = get_command("ACTIVEVC_COMMAND") 29 | ACTIVEVIDEO_COMMAND = get_command("ACTIVEVIDEO_COMMAND") 30 | 31 | 32 | @app.on_message(filters.command(ACTIVEVC_COMMAND) & SUDOERS) 33 | async def activevc(_, message: Message): 34 | mystic = await message.reply_text("» ɢᴇᴛᴛɪɴɢ ᴀᴄᴛɪᴠᴇ ᴠᴏɪᴄᴇ ᴄʜᴀᴛs ʟɪsᴛ...") 35 | served_chats = await get_active_chats() 36 | text = "" 37 | j = 0 38 | for x in served_chats: 39 | try: 40 | title = (await app.get_chat(x)).title 41 | except Exception: 42 | await remove_active_chat(x) 43 | continue 44 | try: 45 | if (await app.get_chat(x)).username: 46 | user = (await app.get_chat(x)).username 47 | text += f"{j + 1}. {unidecode(title).upper()} [{x}]\n" 48 | else: 49 | text += ( 50 | f"{j + 1}. {unidecode(title).upper()} [{x}]\n" 51 | ) 52 | j += 1 53 | except Exception: 54 | continue 55 | if not text: 56 | await mystic.edit_text(f"» ɴᴏ ᴀᴄᴛɪᴠᴇ ᴠᴏɪᴄᴇ ᴄʜᴀᴛs ᴏɴ {app.mention}.") 57 | else: 58 | await mystic.edit_text( 59 | f"» ʟɪsᴛ ᴏғ ᴄᴜʀʀᴇɴᴛʟʏ ᴀᴄᴛɪᴠᴇ ᴠᴏɪᴄᴇ ᴄʜᴀᴛs :\n\n{text}", 60 | disable_web_page_preview=True, 61 | ) 62 | 63 | 64 | @app.on_message(filters.command(ACTIVEVIDEO_COMMAND) & SUDOERS) 65 | async def activevi_(_, message: Message): 66 | mystic = await message.reply_text("» ɢᴇᴛᴛɪɴɢ ᴀᴄᴛɪᴠᴇ ᴠɪᴅᴇᴏ ᴄʜᴀᴛs ʟɪsᴛ...") 67 | served_chats = await get_active_video_chats() 68 | text = "" 69 | j = 0 70 | for x in served_chats: 71 | try: 72 | title = (await app.get_chat(x)).title 73 | except Exception: 74 | await remove_active_video_chat(x) 75 | continue 76 | try: 77 | if (await app.get_chat(x)).username: 78 | user = (await app.get_chat(x)).username 79 | text += f"{j + 1}. {unidecode(title).upper()} [{x}]\n" 80 | else: 81 | text += ( 82 | f"{j + 1}. {unidecode(title).upper()} [{x}]\n" 83 | ) 84 | j += 1 85 | except Exception: 86 | continue 87 | if not text: 88 | await mystic.edit_text(f"» ɴᴏ ᴀᴄᴛɪᴠᴇ ᴠɪᴅᴇᴏ ᴄʜᴀᴛs ᴏɴ {app.mention}.") 89 | else: 90 | await mystic.edit_text( 91 | f"» ʟɪsᴛ ᴏғ ᴄᴜʀʀᴇɴᴛʟʏ ᴀᴄᴛɪᴠᴇ ᴠɪᴅᴇᴏ ᴄʜᴀᴛs :\n\n{text}", 92 | disable_web_page_preview=True, 93 | ) 94 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/tools/languages.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pykeyboard import InlineKeyboard 14 | from pyrogram import filters 15 | from pyrogram.types import InlineKeyboardButton, Message 16 | 17 | from config import BANNED_USERS 18 | from strings import get_command, get_string 19 | from AlexaMusic import app 20 | from AlexaMusic.utils.database import get_lang, set_lang 21 | from AlexaMusic.utils.decorators import ActualAdminCB, language, languageCB 22 | 23 | # Languages Available 24 | 25 | 26 | def lanuages_keyboard(_): 27 | keyboard = InlineKeyboard(row_width=2) 28 | keyboard.row( 29 | InlineKeyboardButton(text="🇦🇺 ᴇɴɢʟɪsʜ 🇦🇺", callback_data="languages:en"), 30 | InlineKeyboardButton(text="🇮🇳 हिन्दी 🇮🇳", callback_data="languages:hi"), 31 | ) 32 | keyboard.row( 33 | InlineKeyboardButton(text="🇱🇰 සිංහල 🇱🇰", callback_data="languages:si"), 34 | InlineKeyboardButton(text="🇦🇿 Azərbaycan 🇦🇿", callback_data="languages:az"), 35 | ) 36 | keyboard.row( 37 | InlineKeyboardButton(text="🇮🇳 ગુજરાતી 🇮🇳", callback_data="languages:gu"), 38 | InlineKeyboardButton( 39 | text="🇹🇷 Türkiye Türkçesi 🇹🇷", 40 | callback_data=f"languages:tr", 41 | ), 42 | ) 43 | keyboard.row( 44 | InlineKeyboardButton( 45 | text="🐕 ᴄʜᴇᴇᴍs 🐕", 46 | callback_data=f"languages:cheems", 47 | ), 48 | ) 49 | keyboard.row( 50 | InlineKeyboardButton( 51 | text=_["BACK_BUTTON"], 52 | callback_data=f"settingsback_helper", 53 | ), 54 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data=f"close"), 55 | ) 56 | return keyboard 57 | 58 | 59 | LANGUAGE_COMMAND = get_command("LANGUAGE_COMMAND") 60 | 61 | 62 | @app.on_message(filters.command(LANGUAGE_COMMAND) & filters.group & ~BANNED_USERS) 63 | @language 64 | async def langs_command(client, message: Message, _): 65 | keyboard = lanuages_keyboard(_) 66 | await message.reply_text( 67 | _["setting_1"].format(message.chat.title, message.chat.id), 68 | reply_markup=keyboard, 69 | ) 70 | 71 | 72 | @app.on_callback_query(filters.regex("LG") & ~BANNED_USERS) 73 | @languageCB 74 | async def lanuagecb(client, CallbackQuery, _): 75 | try: 76 | await CallbackQuery.answer() 77 | except Exception: 78 | pass 79 | keyboard = lanuages_keyboard(_) 80 | return await CallbackQuery.edit_message_reply_markup(reply_markup=keyboard) 81 | 82 | 83 | @app.on_callback_query(filters.regex(r"languages:(.*?)") & ~BANNED_USERS) 84 | @ActualAdminCB 85 | async def language_markup(client, CallbackQuery, _): 86 | langauge = (CallbackQuery.data).split(":")[1] 87 | old = await get_lang(CallbackQuery.message.chat.id) 88 | if str(old) == str(langauge): 89 | return await CallbackQuery.answer( 90 | "ʏᴏᴜ'ʀᴇ ᴀʟʀᴇᴀᴅʏ ᴜsɪɴɢ sᴀᴍᴇ ʟᴀɴɢᴜᴀɢᴇ ғᴏʀ ᴛʜɪs ᴄʜᴀᴛ.", show_alert=True 91 | ) 92 | try: 93 | _ = get_string(langauge) 94 | await CallbackQuery.answer( 95 | "sᴜᴄᴄᴇssғᴜʟʟʏ ᴄʜᴀɴɢᴇᴅ ʏᴏᴜʀ ʟᴀɴɢᴜᴀɢᴇ.", show_alert=True 96 | ) 97 | except Exception: 98 | return await CallbackQuery.answer( 99 | "ғᴀɪʟᴇᴅ ᴛᴏ ᴄʜᴀɴɢᴇ ʟᴀɴɢᴜᴀɢᴇ ᴏʀ ᴛʜᴇ ʟᴀɴɢᴜᴀɢᴇ ɪs ᴜɴᴅᴇʀ ᴍᴀɪɴᴛᴇɴᴀɴᴄᴇ.", 100 | show_alert=True, 101 | ) 102 | await set_lang(CallbackQuery.message.chat.id, langauge) 103 | keyboard = lanuages_keyboard(_) 104 | return await CallbackQuery.edit_message_reply_markup(reply_markup=keyboard) 105 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/tools/lyrics.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import random 14 | import re 15 | import string 16 | 17 | import lyricsgenius as lg 18 | from pyrogram import filters 19 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message 20 | 21 | from config import BANNED_USERS, lyrical 22 | from strings import get_command 23 | from AlexaMusic import app 24 | from AlexaMusic.utils.decorators.language import language 25 | 26 | ###Commands 27 | LYRICS_COMMAND = get_command("LYRICS_COMMAND") 28 | 29 | api_key = "JVv8pud-25QRBYyRwcH34AlAygySsSAU3owRNGBw6hXO96x0JiTMn-3R4PvsjcTf" 30 | y = lg.Genius( 31 | api_key, 32 | skip_non_songs=True, 33 | excluded_terms=["(Remix)", "(Live)"], 34 | remove_section_headers=True, 35 | ) 36 | y.verbose = False 37 | 38 | 39 | @app.on_message(filters.command(LYRICS_COMMAND) & ~BANNED_USERS) 40 | @language 41 | async def lrsearch(client, message: Message, _): 42 | if len(message.command) < 2: 43 | return await message.reply_text(_["lyrics_1"]) 44 | title = message.text.split(None, 1)[1] 45 | m = await message.reply_text(_["lyrics_2"]) 46 | S = y.search_song(title, get_full_info=False) 47 | if S is None: 48 | return await m.edit(_["lyrics_3"].format(title)) 49 | ran_hash = "".join(random.choices(string.ascii_uppercase + string.digits, k=10)) 50 | lyric = S.lyrics 51 | if "Embed" in lyric: 52 | lyric = re.sub(r"\d*Embed", "", lyric) 53 | lyrical[ran_hash] = lyric 54 | upl = InlineKeyboardMarkup( 55 | [ 56 | [ 57 | InlineKeyboardButton( 58 | text=_["L_B_1"], 59 | url=f"https://t.me/{app.username}?start=lyrics_{ran_hash}", 60 | ), 61 | ] 62 | ] 63 | ) 64 | await m.edit(_["lyrics_4"], reply_markup=upl) 65 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/tools/ping.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from datetime import datetime 14 | 15 | from pyrogram import filters 16 | from pyrogram.types import Message 17 | 18 | from config import BANNED_USERS, MUSIC_BOT_NAME, PING_IMG_URL 19 | from strings import get_command 20 | from AlexaMusic import app 21 | from AlexaMusic.core.call import Alexa 22 | from AlexaMusic.utils import bot_sys_stats 23 | from AlexaMusic.utils.decorators.language import language 24 | 25 | ### Commands 26 | PING_COMMAND = get_command("PING_COMMAND") 27 | 28 | 29 | @app.on_message(filters.command(PING_COMMAND) & filters.group & ~BANNED_USERS) 30 | @language 31 | async def ping_com(client, message: Message, _): 32 | response = await message.reply_photo( 33 | photo=PING_IMG_URL, 34 | caption=_["ping_1"], 35 | ) 36 | start = datetime.now() 37 | pytgping = await Alexa.ping() 38 | UP, CPU, RAM, DISK = await bot_sys_stats() 39 | resp = (datetime.now() - start).microseconds / 1000 40 | await response.edit_text( 41 | _["ping_2"].format(resp, MUSIC_BOT_NAME, UP, RAM, CPU, DISK, pytgping) 42 | ) 43 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/tools/reload.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import asyncio 13 | 14 | from pyrogram import filters 15 | from pyrogram.enums import ChatMembersFilter, ChatMemberStatus 16 | from pyrogram.types import CallbackQuery, Message 17 | 18 | from config import BANNED_USERS, MUSIC_BOT_NAME, adminlist, lyrical 19 | from strings import get_command 20 | from AlexaMusic import app 21 | from AlexaMusic.core.call import Alexa 22 | from AlexaMusic.misc import db 23 | from AlexaMusic.utils.database import get_authuser_names, get_cmode 24 | from AlexaMusic.utils.decorators import ActualAdminCB, AdminActual, language 25 | from AlexaMusic.utils.formatters import alpha_to_int 26 | 27 | ### Multi-Lang Commands 28 | RELOAD_COMMAND = get_command("RELOAD_COMMAND") 29 | RESTART_COMMAND = get_command("RESTART_COMMAND") 30 | 31 | 32 | @app.on_message(filters.command(RELOAD_COMMAND) & filters.group & ~BANNED_USERS) 33 | @language 34 | async def reload_admin_cache(client, message: Message, _): 35 | try: 36 | chat_id = message.chat.id 37 | admins = app.get_chat_members(chat_id, filter=ChatMembersFilter.ADMINISTRATORS) 38 | authusers = await get_authuser_names(chat_id) 39 | adminlist[chat_id] = [] 40 | async for user in admins: 41 | if user.privileges.can_manage_video_chats: 42 | adminlist[chat_id].append(user.user.id) 43 | for user in authusers: 44 | user_id = await alpha_to_int(user) 45 | adminlist[chat_id].append(user_id) 46 | await message.reply_text(_["admin_20"]) 47 | except Exception: 48 | await message.reply_text( 49 | "ғᴀɪʟᴇᴅ ᴛᴏ ʀᴇғʀᴇsʜ ᴀᴅᴍɪɴs ʟɪsᴛ, ᴍᴀᴋᴇ sᴜʀᴇ ʏᴏᴜ ᴩʀᴏᴍᴏᴛᴇᴅ ᴛʜᴇ ʙᴏᴛ." 50 | ) 51 | 52 | 53 | @app.on_message(filters.command(RESTART_COMMAND) & filters.group & ~BANNED_USERS) 54 | @AdminActual 55 | async def restartbot(client, message: Message, _): 56 | mystic = await message.reply_text( 57 | f"ᴩʟᴇᴀsᴇ ᴡᴀɪᴛ ʀᴇʙᴏᴏᴛɪɴɢ {MUSIC_BOT_NAME} ғᴏʀ ʏᴏᴜʀ ᴄʜᴀᴛ." 58 | ) 59 | await asyncio.sleep(1) 60 | try: 61 | db[message.chat.id] = [] 62 | await Alexa.stop_stream(message.chat.id) 63 | except Exception: 64 | pass 65 | chat_id = await get_cmode(message.chat.id) 66 | if chat_id: 67 | try: 68 | await app.get_chat(chat_id) 69 | except Exception: 70 | pass 71 | try: 72 | db[chat_id] = [] 73 | await Alexa.stop_stream(chat_id) 74 | except Exception: 75 | pass 76 | return await mystic.edit_text( 77 | "sᴜᴄᴄᴇssғᴜʟʟʏ ʀᴇʙᴏᴏᴛᴇᴅ {MUSIC_BOT_NAME} ғᴏʀ ʏᴏᴜʀ ᴄʜᴀᴛ, ɴᴏᴡ ʏᴏᴜ ᴄᴀɴ sᴛᴀʀᴛ ᴩʟᴀʏɪɴɢ ᴀɢᴀɪɴ..." 78 | ) 79 | 80 | 81 | @app.on_callback_query(filters.regex("close") & ~BANNED_USERS) 82 | async def close_menu(_, CallbackQuery): 83 | try: 84 | await CallbackQuery.message.delete() 85 | await CallbackQuery.answer() 86 | except Exception: 87 | return 88 | 89 | 90 | @app.on_callback_query(filters.regex("close") & ~BANNED_USERS) 91 | async def close_menu(_, CallbackQuery): 92 | try: 93 | await CallbackQuery.message.delete() 94 | await CallbackQuery.answer() 95 | except Exception: 96 | return 97 | 98 | 99 | @app.on_callback_query(filters.regex("stop_downloading") & ~BANNED_USERS) 100 | @ActualAdminCB 101 | async def stop_download(client, CallbackQuery: CallbackQuery, _): 102 | message_id = CallbackQuery.message.id 103 | task = lyrical.get(message_id) 104 | if not task: 105 | return await CallbackQuery.answer( 106 | "ᴅᴏᴡɴʟᴏᴀᴅ ᴀʟʀᴇᴀᴅʏ ᴄᴏᴍᴩʟᴇᴛᴇᴅ.", show_alert=True 107 | ) 108 | if task.done() or task.cancelled(): 109 | return await CallbackQuery.answer( 110 | "ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ ᴀʟʀᴇᴀᴅʏ ᴄᴏᴍᴩʟᴇᴛᴇᴅ ᴏʀ ᴄᴀɴᴄᴇʟʟᴇᴅ.", 111 | show_alert=True, 112 | ) 113 | if not task.done(): 114 | try: 115 | task.cancel() 116 | try: 117 | lyrical.pop(message_id) 118 | except Exception: 119 | pass 120 | await CallbackQuery.answer("ᴅᴏᴡɴʟᴏᴀᴅɪɢ ᴄᴀɴᴄᴇʟʟᴇᴅ.", show_alert=True) 121 | return await CallbackQuery.edit_message_text( 122 | f"ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ ᴩʀᴏᴄᴇss ᴄᴀɴᴄᴇʟʟᴇᴅ ʙʏ {CallbackQuery.from_user.mention}" 123 | ) 124 | except Exception: 125 | return await CallbackQuery.answer( 126 | "ғᴀɪʟᴇᴅ ᴛᴏ ᴄᴀɴᴄᴇʟ ᴅᴏᴡɴʟᴏᴀᴅɪɴɢ...", show_alert=True 127 | ) 128 | await CallbackQuery.answer("ғᴀɪʟᴇᴅ ᴛᴏ ʀᴇᴄᴏɢɴɪᴢᴇ ᴛʜᴇ ᴏɴɢᴏɪɴɢ ᴛᴀsᴋ.", show_alert=True) 129 | -------------------------------------------------------------------------------- /AlexaMusic/plugins/tools/speedtest.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | import speedtest 15 | from pyrogram import filters 16 | from strings import get_command 17 | from AlexaMusic import app 18 | from AlexaMusic.misc import SUDOERS 19 | 20 | # Commands 21 | SPEEDTEST_COMMAND = get_command("SPEEDTEST_COMMAND") 22 | 23 | 24 | async def testspeed(m): 25 | try: 26 | test = speedtest.Speedtest() 27 | test.get_best_server() 28 | await m.edit("⇆ 𝖱𝗎𝗇𝗇𝗂𝗇𝗀 𝖣𝗈𝗐𝗅𝗈𝖺𝖽 𝖲𝗉𝖾𝖾𝖽𝖳𝖾𝗌𝗍 ...") 29 | test.download() 30 | await m.edit("⇆ 𝖱𝗎𝗇𝗇𝗂𝗇𝗀 𝖴𝗉𝗅𝗈𝖺𝖽 𝖲𝗉𝖾𝖾𝖽𝖳𝖾𝗌𝗍 ...") 31 | test.upload() 32 | test.results.share() 33 | result = test.results.dict() 34 | await m.edit("↻ 𝖲𝗁𝖺𝗋𝗂𝗇𝗀 𝖲𝗉𝖾𝖾𝖽𝖳𝖾𝗌𝗍 𝖱𝖾𝗌𝗎𝗅𝗍𝗌 ...") 35 | except Exception as e: 36 | return await m.edit(str(e)) 37 | return result 38 | 39 | 40 | @app.on_message(filters.command(SPEEDTEST_COMMAND) & SUDOERS) 41 | async def speedtest_function(client, message): 42 | m = await message.reply_text("» 𝖱𝗎𝗇𝗇𝗂𝗇𝗀 𝖠 𝖲𝗉𝖾𝖾𝖽𝖳𝖾𝗌𝗍 ...") 43 | result = await testspeed(m) 44 | output = f"""✯ 𝖲𝗉𝖾𝖾𝖽𝖳𝖾𝗌𝗍 𝖱𝖾𝗌𝗎𝗅𝗍𝗌 ✯ 45 | 46 | 𝖢𝗅𝗂𝖾𝗇𝗍 : 47 | » 𝖨𝖲𝖯 : {result['client']['isp']} 48 | » 𝖢𝗈𝗎𝗇𝗍𝗋𝗒 : {result['client']['country']} 49 | 50 | 𝖲𝖾𝗋𝗏𝖾𝗋 : 51 | » 𝖭𝖺𝗆𝖾 : {result['server']['name']} 52 | » 𝖢𝗈𝗎𝗇𝗍𝗋𝗒 : {result['server']['country']}, {result['server']['cc']} 53 | » 𝖲𝗉𝗈𝗇𝗌𝗈𝗋 : {result['server']['sponsor']} 54 | » 𝖫𝖺𝗍𝖾𝗇𝖼𝗒 : {result['server']['latency']} 55 | » 𝖯𝗂𝗇𝗀 : {result['ping']} 56 | """ 57 | msg = await app.send_photo( 58 | chat_id=message.chat.id, photo=result["share"], caption=output 59 | ) 60 | await m.delete() 61 | -------------------------------------------------------------------------------- /AlexaMusic/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from .channelplay import * 13 | from .database import * 14 | from .decorators import * 15 | from .formatters import * 16 | from .inline import * 17 | from .pastebin import * 18 | from .sys import * 19 | -------------------------------------------------------------------------------- /AlexaMusic/utils/channelplay.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from AlexaMusic import app 14 | from AlexaMusic.utils.database import get_cmode 15 | 16 | 17 | async def get_channeplayCB(_, command, CallbackQuery): 18 | if command == "c": 19 | chat_id = await get_cmode(CallbackQuery.message.chat.id) 20 | if chat_id is None: 21 | try: 22 | return await CallbackQuery.answer(_["setting_12"], show_alert=True) 23 | except Exception: 24 | return 25 | try: 26 | chat = await app.get_chat(chat_id) 27 | channel = chat.title 28 | except Exception: 29 | try: 30 | return await CallbackQuery.answer(_["cplay_4"], show_alert=True) 31 | except Exception: 32 | return 33 | else: 34 | chat_id = CallbackQuery.message.chat.id 35 | channel = None 36 | return chat_id, channel 37 | -------------------------------------------------------------------------------- /AlexaMusic/utils/command.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from typing import Union, List 13 | from pyrogram import filters 14 | 15 | other_filters = filters.group & ~filters.via_bot & ~filters.forwarded 16 | other_filters2 = filters.private & ~filters.via_bot & ~filters.forwarded 17 | 18 | 19 | def commandpro(commands: Union[str, List[str]]): 20 | return filters.command(commands, "") 21 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from .assistantdatabase import * 14 | from .memorydatabase import * 15 | from .mongodatabase import * 16 | from .theme import * 17 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/assistantdatabase.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import random 13 | 14 | from AlexaMusic import userbot 15 | from AlexaMusic.core.mongo import mongodb 16 | 17 | db = mongodb.assistants 18 | 19 | assistantdict = {} 20 | 21 | 22 | async def get_client(assistant: int): 23 | if assistant == 1: 24 | return userbot.one 25 | elif assistant == 2: 26 | return userbot.two 27 | elif assistant == 3: 28 | return userbot.three 29 | elif assistant == 4: 30 | return userbot.four 31 | elif assistant == 5: 32 | return userbot.five 33 | 34 | 35 | async def set_assistant(chat_id): 36 | from AlexaMusic.core.userbot import assistants 37 | 38 | ran_assistant = random.choice(assistants) 39 | assistantdict[chat_id] = ran_assistant 40 | await db.update_one( 41 | {"chat_id": chat_id}, 42 | {"$set": {"assistant": ran_assistant}}, 43 | upsert=True, 44 | ) 45 | userbot = await get_client(ran_assistant) 46 | return userbot 47 | 48 | 49 | async def get_assistant(chat_id: int) -> str: 50 | from AlexaMusic.core.userbot import assistants 51 | 52 | assistant = assistantdict.get(chat_id) 53 | if not assistant: 54 | dbassistant = await db.find_one({"chat_id": chat_id}) 55 | if not dbassistant: 56 | userbot = await set_assistant(chat_id) 57 | else: 58 | got_assis = dbassistant["assistant"] 59 | if got_assis in assistants: 60 | assistantdict[chat_id] = got_assis 61 | userbot = await get_client(got_assis) 62 | else: 63 | userbot = await set_assistant(chat_id) 64 | else: 65 | if assistant in assistants: 66 | userbot = await get_client(assistant) 67 | else: 68 | userbot = await set_assistant(chat_id) 69 | 70 | return userbot 71 | 72 | 73 | async def set_calls_assistant(chat_id): 74 | from AlexaMusic.core.userbot import assistants 75 | 76 | ran_assistant = random.choice(assistants) 77 | assistantdict[chat_id] = ran_assistant 78 | await db.update_one( 79 | {"chat_id": chat_id}, 80 | {"$set": {"assistant": ran_assistant}}, 81 | upsert=True, 82 | ) 83 | return ran_assistant 84 | 85 | 86 | async def group_assistant(self, chat_id: int) -> int: 87 | from AlexaMusic.core.userbot import assistants 88 | 89 | if assistant := assistantdict.get(chat_id): 90 | assis = ( 91 | assistant if assistant in assistants else await set_calls_assistant(chat_id) 92 | ) 93 | else: 94 | dbassistant = await db.find_one({"chat_id": chat_id}) 95 | if not dbassistant: 96 | assis = await set_calls_assistant(chat_id) 97 | else: 98 | assis = dbassistant["assistant"] 99 | if assis in assistants: 100 | assistantdict[chat_id] = assis 101 | assis = assis 102 | else: 103 | assis = await set_calls_assistant(chat_id) 104 | if int(assis) == 1: 105 | return self.one 106 | elif int(assis) == 2: 107 | return self.two 108 | elif int(assis) == 3: 109 | return self.three 110 | elif int(assis) == 4: 111 | return self.four 112 | elif int(assis) == 5: 113 | return self.five 114 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/brtools.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import asyncio 14 | import datetime 15 | import os 16 | import random 17 | import string 18 | import time 19 | import traceback 20 | 21 | import aiofiles 22 | from pyrogram.errors import ( 23 | FloodWait, 24 | InputUserDeactivated, 25 | PeerIdInvalid, 26 | UserIsBlocked, 27 | ) 28 | from protector.brdb import db, dcmdb 29 | 30 | # BR Tools 31 | 32 | broadcast_ids = {} 33 | 34 | 35 | async def main_broadcast_handler(m, db): 36 | all_users = await db.get_all_users() 37 | broadcast_msg = m.reply_to_message 38 | while True: 39 | broadcast_id = "".join(random.choice(string.ascii_letters) for _ in range(3)) 40 | if not broadcast_ids.get(broadcast_id): 41 | break 42 | out = await m.reply_text( 43 | text="**💡 Bʀᴏᴀᴅᴄᴀsᴛ Sᴛᴀʀᴛᴇᴅ...**\n\n**» Wʜᴇɴ ɪᴛ's ᴅᴏɴᴇ, ʏᴏᴜ'ʟʟ ʙᴇ ɴᴏᴛɪғɪᴇᴅ ʜᴇʀᴇ...!**" 44 | ) 45 | 46 | start_time = time.time() 47 | total_users = await db.total_users_count() 48 | done = 0 49 | failed = 0 50 | success = 0 51 | broadcast_ids[broadcast_id] = dict( 52 | total=total_users, current=done, failed=failed, success=success 53 | ) 54 | async with aiofiles.open("broadcast-logs.txt", "w") as broadcast_log_file: 55 | async for user in all_users: 56 | sts, msg = await send_msg(user_id=int(user["id"]), message=broadcast_msg) 57 | if msg is not None: 58 | await broadcast_log_file.write(msg) 59 | if sts == 200: 60 | success += 1 61 | else: 62 | failed += 1 63 | if sts == 400: 64 | await db.delete_user(user["id"]) 65 | done += 1 66 | if broadcast_ids.get(broadcast_id) is None: 67 | break 68 | else: 69 | broadcast_ids[broadcast_id].update( 70 | dict(current=done, failed=failed, success=success) 71 | ) 72 | if broadcast_ids.get(broadcast_id): 73 | broadcast_ids.pop(broadcast_id) 74 | completed_in = datetime.timedelta(seconds=int(time.time() - start_time)) 75 | await asyncio.sleep(3) 76 | await out.delete() 77 | if failed == 0: 78 | await m.reply_text( 79 | text=f"✅ Bʀᴏᴀᴅᴄᴀsᴛɪɴɢ Cᴏᴍᴘʟᴇᴛᴇᴅ! \n**Completed in:** `{completed_in}` \n\n**Total users:** `{total_users}` \n**Total done:** `{done}` \n**Total success:** `{success}` \n**Total failed:** `{failed}`", 80 | quote=True, 81 | ) 82 | else: 83 | await m.reply_document( 84 | document="broadcast-logs.txt", 85 | caption=f"✅ Bʀᴏᴀᴅᴄᴀsᴛɪɴɢ Cᴏᴍᴘʟᴇᴛᴇᴅ! \n**Completed in:** `{completed_in}`\n\n**Total users:** `{total_users}` \n**Total done:** `{done}` \n**Total success:** `{success}` \n**Total failed:** `{failed}`", 86 | quote=True, 87 | ) 88 | os.remove("broadcast-logs.txt") 89 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/chats.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from typing import Dict, List, Union 14 | 15 | from AlexaMusic.core.mongo import mongodb 16 | 17 | chatsdb = db.chats 18 | 19 | 20 | async def get_served_chats() -> list: 21 | chats = chatsdb.find({"chat_id": {"$lt": 0}}) 22 | return list(await chats.to_list(length=1000000000)) if chats else [] 23 | 24 | 25 | async def is_served_chat(chat_id: int) -> bool: 26 | chat = await chatsdb.find_one({"chat_id": chat_id}) 27 | return bool(chat) 28 | 29 | 30 | async def add_served_chat(chat_id: int): 31 | is_served = await is_served_chat(chat_id) 32 | if is_served: 33 | return 34 | return await chatsdb.insert_one({"chat_id": chat_id}) 35 | 36 | 37 | async def remove_served_chat(chat_id: int): 38 | is_served = await is_served_chat(chat_id) 39 | if not is_served: 40 | return 41 | return await chatsdb.delete_one({"chat_id": chat_id}) 42 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/gban.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from typing import Dict, List, Union 14 | 15 | from AlexaMusic.core.mongo import mongodb 16 | 17 | gbansdb = db.gban 18 | 19 | 20 | async def get_gbans_count() -> int: 21 | users = gbansdb.find({"user_id": {"$gt": 0}}) 22 | users = await users.to_list(length=100000) 23 | return len(users) 24 | 25 | 26 | async def is_gbanned_user(user_id: int) -> bool: 27 | user = await gbansdb.find_one({"user_id": user_id}) 28 | return bool(user) 29 | 30 | 31 | async def add_gban_user(user_id: int): 32 | is_gbanned = await is_gbanned_user(user_id) 33 | if is_gbanned: 34 | return 35 | return await gbansdb.insert_one({"user_id": user_id}) 36 | 37 | 38 | async def remove_gban_user(user_id: int): 39 | is_gbanned = await is_gbanned_user(user_id) 40 | if not is_gbanned: 41 | return 42 | return await gbansdb.delete_one({"user_id": user_id}) 43 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/onoff.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from typing import Dict, List, Union 14 | 15 | from AlexaMusic.core.mongo import mongodb 16 | 17 | 18 | onoffdb = mongodb.onoffper 19 | 20 | 21 | async def is_on_off(on_off: int) -> bool: 22 | onoff = await onoffdb.find_one({"on_off": on_off}) 23 | return bool(onoff) 24 | 25 | 26 | async def add_on(on_off: int): 27 | is_on = await is_on_off(on_off) 28 | if is_on: 29 | return 30 | return await onoffdb.insert_one({"on_off": on_off}) 31 | 32 | 33 | async def add_off(on_off: int): 34 | is_off = await is_on_off(on_off) 35 | if not is_off: 36 | return 37 | return await onoffdb.delete_one({"on_off": on_off}) 38 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/pmpermit.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from typing import Dict, List, Union 13 | 14 | from AlexaMusic.core.mongo import mongodb 15 | 16 | 17 | pmpermitdb = mongodb.permit 18 | 19 | 20 | async def is_pmpermit_approved(user_id: int) -> bool: 21 | user = await pmpermitdb.find_one({"user_id": user_id}) 22 | return bool(user) 23 | 24 | 25 | async def approve_pmpermit(user_id: int): 26 | is_pmpermit = await is_pmpermit_approved(user_id) 27 | if is_pmpermit: 28 | return 29 | return await pmpermitdb.insert_one({"user_id": user_id}) 30 | 31 | 32 | async def disapprove_pmpermit(user_id: int): 33 | is_pmpermit = await is_pmpermit_approved(user_id) 34 | if not is_pmpermit: 35 | return 36 | return await pmpermitdb.delete_one({"user_id": user_id}) 37 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/sudo.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from typing import Dict, List, Union 13 | 14 | from AlexaMusic.core.mongo import mongodb 15 | 16 | sudoersdb = db.sudoers 17 | 18 | 19 | async def get_sudoers() -> list: 20 | sudoers = await sudoersdb.find_one({"sudo": "sudo"}) 21 | return sudoers["sudoers"] if sudoers else [] 22 | 23 | 24 | async def add_sudo(user_id: int) -> bool: 25 | sudoers = await get_sudoers() 26 | sudoers.append(user_id) 27 | await sudoersdb.update_one( 28 | {"sudo": "sudo"}, {"$set": {"sudoers": sudoers}}, upsert=True 29 | ) 30 | return True 31 | 32 | 33 | async def remove_sudo(user_id: int) -> bool: 34 | sudoers = await get_sudoers() 35 | sudoers.remove(user_id) 36 | await sudoersdb.update_one( 37 | {"sudo": "sudo"}, {"$set": {"sudoers": sudoers}}, upsert=True 38 | ) 39 | return True 40 | -------------------------------------------------------------------------------- /AlexaMusic/utils/database/theme.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | # from typing import Dict, List, Union 14 | # from AlexaMusic.core.mongo import mongodb 15 | 16 | # themedb = mongodb.notes 17 | 18 | 19 | # async def _get_theme(chat_id: int) -> Dict[str, int]: 20 | # _notes = await themedb.find_one({"chat_id": chat_id}) 21 | # if not _notes: 22 | # return {} 23 | # return _notes["notes"] 24 | 25 | 26 | # async def get_theme(chat_id: int, name: str) -> Union[bool, dict]: 27 | # name = name.lower().strip() 28 | # _notes = await _get_theme(chat_id) 29 | # if name in _notes: 30 | # return _notes[name] 31 | # else: 32 | # return False 33 | 34 | 35 | # async def save_theme(chat_id: int, name: str, note: dict): 36 | # name = name.lower().strip() 37 | # _notes = await _get_theme(chat_id) 38 | # _notes[name] = note 39 | # await themedb.update_one( 40 | # {"chat_id": chat_id}, {"$set": {"notes": _notes}}, upsert=True 41 | # ) 42 | -------------------------------------------------------------------------------- /AlexaMusic/utils/decorators/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from .admins import * 14 | from .language import * 15 | -------------------------------------------------------------------------------- /AlexaMusic/utils/decorators/language.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from strings import get_string 14 | from AlexaMusic.misc import SUDOERS 15 | from AlexaMusic.utils.database import get_lang, is_commanddelete_on, is_maintenance 16 | 17 | 18 | def language(mystic): 19 | async def wrapper(_, message, **kwargs): 20 | if await is_maintenance() is False and message.from_user.id not in SUDOERS: 21 | return await message.reply_text( 22 | "» ʙᴏᴛ ɪs ᴜɴᴅᴇʀ ᴍᴀɪɴᴛᴇɴᴀɴᴄᴇ ғᴏʀ sᴏᴍᴇ ᴛɪᴍᴇ, ᴩʟᴇᴀsᴇ ᴠɪsɪᴛ sᴜᴩᴩᴏʀᴛ ᴄʜᴀᴛ ᴛᴏ ᴋɴᴏᴡ ᴛʜᴇ ʀᴇᴀsᴏɴ." 23 | ) 24 | if await is_commanddelete_on(message.chat.id): 25 | try: 26 | await message.delete() 27 | except Exception: 28 | pass 29 | try: 30 | language = await get_lang(message.chat.id) 31 | language = get_string(language) 32 | except Exception: 33 | language = get_string("en") 34 | return await mystic(_, message, language) 35 | 36 | return wrapper 37 | 38 | 39 | def languageCB(mystic): 40 | async def wrapper(_, CallbackQuery, **kwargs): 41 | if ( 42 | await is_maintenance() is False 43 | and CallbackQuery.from_user.id not in SUDOERS 44 | ): 45 | return await CallbackQuery.answer( 46 | "» ʙᴏᴛ ɪs ᴜɴᴅᴇʀ ᴍᴀɪɴᴛᴇɴᴀɴᴄᴇ ғᴏʀ sᴏᴍᴇ ᴛɪᴍᴇ, ᴩʟᴇᴀsᴇ ᴠɪsɪᴛ sᴜᴩᴩᴏʀᴛ ᴄʜᴀᴛ ᴛᴏ ᴋɴᴏᴡ ᴛʜᴇ ʀᴇᴀsᴏɴ.", 47 | show_alert=True, 48 | ) 49 | try: 50 | language = await get_lang(CallbackQuery.message.chat.id) 51 | language = get_string(language) 52 | except Exception: 53 | language = get_string("en") 54 | return await mystic(_, CallbackQuery, language) 55 | 56 | return wrapper 57 | 58 | 59 | def LanguageStart(mystic): 60 | async def wrapper(_, message, **kwargs): 61 | try: 62 | language = await get_lang(message.chat.id) 63 | language = get_string(language) 64 | except Exception: 65 | language = get_string("en") 66 | return await mystic(_, message, language) 67 | 68 | return wrapper 69 | -------------------------------------------------------------------------------- /AlexaMusic/utils/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | class AssistantErr(Exception): 14 | def __init__(self, errr: str): 15 | super().__init__(errr) 16 | -------------------------------------------------------------------------------- /AlexaMusic/utils/formatters.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | def get_readable_time(seconds: int) -> str: 14 | count = 0 15 | ping_time = "" 16 | time_list = [] 17 | time_suffix_list = ["s", "m", "h", "days"] 18 | while count < 4: 19 | count += 1 20 | remainder, result = divmod(seconds, 60) if count < 3 else divmod(seconds, 24) 21 | if seconds == 0 and remainder == 0: 22 | break 23 | time_list.append(int(result)) 24 | seconds = int(remainder) 25 | for i in range(len(time_list)): 26 | time_list[i] = str(time_list[i]) + time_suffix_list[i] 27 | if len(time_list) == 4: 28 | ping_time += f"{time_list.pop()}, " 29 | time_list.reverse() 30 | ping_time += ":".join(time_list) 31 | return ping_time 32 | 33 | 34 | def convert_bytes(size: float) -> str: 35 | """humanize size""" 36 | if not size: 37 | return "" 38 | power = 1024 39 | t_n = 0 40 | power_dict = {0: " ", 1: "Ki", 2: "Mi", 3: "Gi", 4: "Ti"} 41 | while size > power: 42 | size /= power 43 | t_n += 1 44 | return "{:.2f} {}B".format(size, power_dict[t_n]) 45 | 46 | 47 | async def int_to_alpha(user_id: int) -> str: 48 | alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] 49 | text = "" 50 | user_id = str(user_id) 51 | for i in user_id: 52 | text += alphabet[int(i)] 53 | return text 54 | 55 | 56 | async def alpha_to_int(user_id_alphabet: str) -> int: 57 | alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] 58 | user_id = "" 59 | for i in user_id_alphabet: 60 | index = alphabet.index(i) 61 | user_id += str(index) 62 | return int(user_id) 63 | 64 | 65 | def time_to_seconds(time): 66 | stringt = str(time) 67 | return sum(int(x) * 60**i for i, x in enumerate(reversed(stringt.split(":")))) 68 | 69 | 70 | def seconds_to_min(seconds): 71 | if seconds is not None: 72 | seconds = int(seconds) 73 | d, h, m, s = ( 74 | seconds // (3600 * 24), 75 | seconds // 3600 % 24, 76 | seconds % 3600 // 60, 77 | seconds % 3600 % 60, 78 | ) 79 | if d > 0: 80 | return "{:02d}:{:02d}:{:02d}:{:02d}".format(d, h, m, s) 81 | elif h > 0: 82 | return "{:02d}:{:02d}:{:02d}".format(h, m, s) 83 | elif m > 0: 84 | return "{:02d}:{:02d}".format(m, s) 85 | elif s > 0: 86 | return "00:{:02d}".format(s) 87 | return "-" 88 | 89 | 90 | formats = [ 91 | "webm", 92 | "mkv", 93 | "flv", 94 | "vob", 95 | "ogv", 96 | "ogg", 97 | "rrc", 98 | "gifv", 99 | "mng", 100 | "mov", 101 | "avi", 102 | "qt", 103 | "wmv", 104 | "yuv", 105 | "rm", 106 | "asf", 107 | "amv", 108 | "mp4", 109 | "m4p", 110 | "m4v", 111 | "mpg", 112 | "mp2", 113 | "mpeg", 114 | "mpe", 115 | "mpv", 116 | "m4v", 117 | "svi", 118 | "3gp", 119 | "3g2", 120 | "mxf", 121 | "roq", 122 | "nsv", 123 | "flv", 124 | "f4v", 125 | "f4p", 126 | "f4a", 127 | "f4b", 128 | ] 129 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inline/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from .help import * 14 | from .play import * 15 | from .playlist import * 16 | from .queue import * 17 | from .settings import * 18 | from .song import * 19 | from .start import * 20 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inline/help.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from typing import Union 14 | 15 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 16 | 17 | from AlexaMusic import app 18 | 19 | 20 | def help_pannel(_, START: Union[bool, int] = None): 21 | first = [InlineKeyboardButton(text=_["CLOSEMENU_BUTTON"], callback_data="close")] 22 | second = [ 23 | InlineKeyboardButton( 24 | text=_["BACK_BUTTON"], 25 | callback_data="help_back", 26 | ), 27 | InlineKeyboardButton(text=_["CLOSEMENU_BUTTON"], callback_data="close"), 28 | ] 29 | mark = second if START else first 30 | return InlineKeyboardMarkup( 31 | [ 32 | [ 33 | InlineKeyboardButton( 34 | text=_["H_B_2"], 35 | callback_data="help_callback hb2", 36 | ), 37 | InlineKeyboardButton( 38 | text=_["H_B_1"], 39 | callback_data="help_callback hb1", 40 | ), 41 | ], 42 | [ 43 | InlineKeyboardButton( 44 | text=_["H_B_3"], 45 | callback_data="help_callback hb3", 46 | ), 47 | InlineKeyboardButton( 48 | text=_["H_B_4"], 49 | callback_data="help_callback hb4", 50 | ), 51 | ], 52 | [ 53 | InlineKeyboardButton( 54 | text=_["H_B_7"], 55 | callback_data="help_callback hb7", 56 | ), 57 | ], 58 | [ 59 | InlineKeyboardButton( 60 | text=_["H_B_8"], 61 | callback_data="help_callback hb8", 62 | ), 63 | InlineKeyboardButton( 64 | text=_["H_B_6"], 65 | callback_data="help_callback hb5", 66 | ), 67 | ], 68 | mark, 69 | ] 70 | ) 71 | 72 | 73 | def help_back_markup(_): 74 | return InlineKeyboardMarkup( 75 | [ 76 | [ 77 | InlineKeyboardButton( 78 | text=_["BACK_BUTTON"], callback_data="settings_back_helper" 79 | ), 80 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data="close"), 81 | ] 82 | ] 83 | ) 84 | 85 | 86 | def private_help_panel(_): 87 | return [ 88 | [ 89 | InlineKeyboardButton( 90 | text=_["S_B_1"], 91 | url=f"https://t.me/{app.username}?start=help", 92 | ), 93 | ], 94 | ] 95 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inline/playlist.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 14 | 15 | 16 | def botplaylist_markup(_): 17 | return [ 18 | [ 19 | InlineKeyboardButton( 20 | text=_["PL_B_1"], 21 | callback_data="get_playlist_playmode", 22 | ), 23 | InlineKeyboardButton(text=_["PL_B_8"], callback_data="get_top_playlists"), 24 | ], 25 | [ 26 | InlineKeyboardButton(text=_["PL_B_4"], callback_data="PM"), 27 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data="close"), 28 | ], 29 | ] 30 | 31 | 32 | def top_play_markup(_): 33 | return [ 34 | [InlineKeyboardButton(text=_["PL_B_9"], callback_data="SERVERTOP global")], 35 | [InlineKeyboardButton(text=_["PL_B_10"], callback_data="SERVERTOP chat")], 36 | [InlineKeyboardButton(text=_["PL_B_11"], callback_data="SERVERTOP user")], 37 | [ 38 | InlineKeyboardButton(text=_["BACK_BUTTON"], callback_data="get_playmarkup"), 39 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data="close"), 40 | ], 41 | ] 42 | 43 | 44 | def get_playlist_markup(_): 45 | return [ 46 | [ 47 | InlineKeyboardButton(text=_["P_B_1"], callback_data="play_playlist a"), 48 | InlineKeyboardButton(text=_["P_B_2"], callback_data="play_playlist b"), 49 | ], 50 | [ 51 | InlineKeyboardButton(text=_["BACK_BUTTON"], callback_data="home_play"), 52 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data="close"), 53 | ], 54 | ] 55 | 56 | 57 | def top_play_markup(_): 58 | return [ 59 | [InlineKeyboardButton(text=_["PL_B_9"], callback_data="SERVERTOP Global")], 60 | [InlineKeyboardButton(text=_["PL_B_10"], callback_data="SERVERTOP Group")], 61 | [InlineKeyboardButton(text=_["PL_B_11"], callback_data="SERVERTOP Personal")], 62 | [ 63 | InlineKeyboardButton(text=_["BACK_BUTTON"], callback_data="get_playmarkup"), 64 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data="close"), 65 | ], 66 | ] 67 | 68 | 69 | def failed_top_markup(_): 70 | return [ 71 | [ 72 | InlineKeyboardButton( 73 | text=_["BACK_BUTTON"], 74 | callback_data="get_top_playlists", 75 | ), 76 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data="close"), 77 | ], 78 | ] 79 | 80 | 81 | def warning_markup(_): 82 | return InlineKeyboardMarkup( 83 | [ 84 | [ 85 | InlineKeyboardButton( 86 | text=_["PL_B_7"], 87 | callback_data="delete_whole_playlist", 88 | ), 89 | ], 90 | [ 91 | InlineKeyboardButton( 92 | text=_["BACK_BUTTON"], 93 | callback_data="del_back_playlist", 94 | ), 95 | InlineKeyboardButton( 96 | text=_["CLOSE_BUTTON"], 97 | callback_data="close", 98 | ), 99 | ], 100 | ] 101 | ) 102 | 103 | 104 | def close_markup(_): 105 | return InlineKeyboardMarkup( 106 | [ 107 | [ 108 | InlineKeyboardButton( 109 | text=_["CLOSE_BUTTON"], 110 | callback_data="close", 111 | ), 112 | ] 113 | ] 114 | ) 115 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inline/queue.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from typing import Union 14 | 15 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 16 | 17 | 18 | def queue_markup( 19 | _, 20 | DURATION, 21 | CPLAY, 22 | videoid, 23 | played: Union[bool, int] = None, 24 | dur: Union[bool, int] = None, 25 | ): 26 | not_dur = [ 27 | [ 28 | InlineKeyboardButton( 29 | text=_["QU_B_1"], 30 | callback_data=f"GetQueued {CPLAY}|{videoid}", 31 | ), 32 | InlineKeyboardButton( 33 | text=_["CLOSEMENU_BUTTON"], 34 | callback_data="close", 35 | ), 36 | ] 37 | ] 38 | dur = [ 39 | [ 40 | InlineKeyboardButton( 41 | text=_["QU_B_2"].format(played, dur), 42 | callback_data="GetTimer", 43 | ) 44 | ], 45 | [ 46 | InlineKeyboardButton( 47 | text=_["QU_B_1"], 48 | callback_data=f"GetQueued {CPLAY}|{videoid}", 49 | ), 50 | InlineKeyboardButton( 51 | text=_["CLOSEMENU_BUTTON"], 52 | callback_data="close", 53 | ), 54 | ], 55 | ] 56 | return InlineKeyboardMarkup(not_dur if DURATION == "Unknown" else dur) 57 | 58 | 59 | def queue_back_markup(_, CPLAY): 60 | return InlineKeyboardMarkup( 61 | [ 62 | [ 63 | InlineKeyboardButton( 64 | text=_["BACK_BUTTON"], 65 | callback_data=f"queue_back_timer {CPLAY}", 66 | ), 67 | InlineKeyboardButton( 68 | text=_["CLOSE_BUTTON"], 69 | callback_data="close", 70 | ), 71 | ] 72 | ] 73 | ) 74 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inline/song.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import config 13 | from pyrogram.types import InlineKeyboardButton 14 | 15 | 16 | def song_markup(_, vidid): 17 | return [ 18 | [ 19 | InlineKeyboardButton( 20 | text=_["SG_B_2"], 21 | callback_data=f"song_helper audio|{vidid}", 22 | ), 23 | InlineKeyboardButton( 24 | text=_["SG_B_3"], 25 | callback_data=f"song_helper video|{vidid}", 26 | ), 27 | ], 28 | [ 29 | InlineKeyboardButton( 30 | text="🌻 sᴜᴩᴩᴏʀᴛ 🌻", 31 | url=config.SUPPORT_GROUP, 32 | ), 33 | InlineKeyboardButton(text=_["CLOSE_BUTTON"], callback_data="close"), 34 | ], 35 | ] 36 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inline/start.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from typing import Union 14 | 15 | from pyrogram.types import InlineKeyboardButton 16 | 17 | from config import GITHUB_REPO, SUPPORT_CHANNEL, SUPPORT_GROUP, OWNER_ID 18 | from AlexaMusic import app 19 | 20 | 21 | def start_pannel(_): 22 | buttons = [ 23 | [ 24 | InlineKeyboardButton( 25 | text=_["S_B_1"], 26 | url=f"https://t.me/{app.username}?start=help", 27 | ), 28 | InlineKeyboardButton(text=_["S_B_2"], callback_data="settings_helper"), 29 | ], 30 | ] 31 | if SUPPORT_CHANNEL and SUPPORT_GROUP: 32 | buttons.append( 33 | [ 34 | InlineKeyboardButton(text=_["S_B_4"], url=f"{SUPPORT_CHANNEL}"), 35 | InlineKeyboardButton(text=_["S_B_3"], url=f"{SUPPORT_GROUP}"), 36 | ] 37 | ) 38 | else: 39 | if SUPPORT_CHANNEL: 40 | buttons.append( 41 | [InlineKeyboardButton(text=_["S_B_4"], url=f"{SUPPORT_CHANNEL}")] 42 | ) 43 | if SUPPORT_GROUP: 44 | buttons.append( 45 | [InlineKeyboardButton(text=_["S_B_3"], url=f"{SUPPORT_GROUP}")] 46 | ) 47 | return buttons 48 | 49 | 50 | def private_panel(_, BOT_USERNAME, OWNER: Union[bool, int] = None): 51 | buttons = [ 52 | [InlineKeyboardButton(text=_["S_B_8"], callback_data="settings_back_helper")] 53 | ] 54 | if SUPPORT_CHANNEL and SUPPORT_GROUP: 55 | buttons.append( 56 | [ 57 | InlineKeyboardButton(text=_["S_B_4"], url=f"{SUPPORT_CHANNEL}"), 58 | InlineKeyboardButton(text=_["S_B_3"], url=f"{SUPPORT_GROUP}"), 59 | ] 60 | ) 61 | else: 62 | if SUPPORT_CHANNEL: 63 | buttons.append( 64 | [InlineKeyboardButton(text=_["S_B_4"], url=f"{SUPPORT_CHANNEL}")] 65 | ) 66 | if SUPPORT_GROUP: 67 | buttons.append( 68 | [InlineKeyboardButton(text=_["S_B_3"], url=f"{SUPPORT_GROUP}")] 69 | ) 70 | buttons.append( 71 | [ 72 | InlineKeyboardButton( 73 | text=_["S_B_5"], 74 | url=f"https://t.me/{BOT_USERNAME}?startgroup=true", 75 | ) 76 | ] 77 | ) 78 | if GITHUB_REPO and OWNER_ID: 79 | buttons.append( 80 | [ 81 | InlineKeyboardButton(text=_["S_B_7"], user_id=OWNER_ID), 82 | InlineKeyboardButton(text=_["S_B_6"], url=f"{GITHUB_REPO}"), 83 | ] 84 | ) 85 | else: 86 | if GITHUB_REPO: 87 | buttons.append( 88 | [ 89 | InlineKeyboardButton(text=_["S_B_6"], url=f"{GITHUB_REPO}"), 90 | ] 91 | ) 92 | if OWNER: 93 | buttons.append( 94 | [ 95 | InlineKeyboardButton(text=_["S_B_7"], user_id=OWNER_ID), 96 | ] 97 | ) 98 | return buttons 99 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inline/stats.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup 14 | 15 | from AlexaMusic import app 16 | 17 | 18 | def back_stats_markup(_): 19 | return InlineKeyboardMarkup( 20 | [ 21 | [ 22 | InlineKeyboardButton( 23 | text=_["BACK_BUTTON"], 24 | callback_data="TOPMARKUPGET", 25 | ), 26 | InlineKeyboardButton( 27 | text=_["CLOSE_BUTTON"], 28 | callback_data="close", 29 | ), 30 | ], 31 | ] 32 | ) 33 | 34 | 35 | def overallback_stats_markup(_): 36 | return InlineKeyboardMarkup( 37 | [ 38 | [ 39 | InlineKeyboardButton( 40 | text=_["BACK_BUTTON"], 41 | callback_data="GlobalStats", 42 | ), 43 | InlineKeyboardButton( 44 | text=_["CLOSE_BUTTON"], 45 | callback_data="close", 46 | ), 47 | ], 48 | ] 49 | ) 50 | 51 | 52 | def get_stats_markup(_, status): 53 | not_sudo = [ 54 | InlineKeyboardButton( 55 | text=_["CLOSEMENU_BUTTON"], 56 | callback_data="close", 57 | ) 58 | ] 59 | sudo = [ 60 | InlineKeyboardButton( 61 | text=_["SA_B_8"], 62 | callback_data="bot_stats_sudo g", 63 | ), 64 | InlineKeyboardButton( 65 | text=_["CLOSEMENU_BUTTON"], 66 | callback_data="close", 67 | ), 68 | ] 69 | return InlineKeyboardMarkup( 70 | [ 71 | [ 72 | InlineKeyboardButton( 73 | text=_["SA_B_7"], 74 | callback_data="TOPMARKUPGET", 75 | ) 76 | ], 77 | [ 78 | InlineKeyboardButton( 79 | text=_["SA_B_6"], 80 | url=f"https://t.me/{app.username}?start=stats", 81 | ), 82 | InlineKeyboardButton( 83 | text=_["SA_B_5"], 84 | callback_data="TopOverall g", 85 | ), 86 | ], 87 | sudo if status else not_sudo, 88 | ] 89 | ) 90 | 91 | 92 | def stats_buttons(_, status): 93 | not_sudo = [ 94 | InlineKeyboardButton( 95 | text=_["SA_B_5"], 96 | callback_data="TopOverall s", 97 | ) 98 | ] 99 | sudo = [ 100 | InlineKeyboardButton( 101 | text=_["SA_B_8"], 102 | callback_data="bot_stats_sudo s", 103 | ), 104 | InlineKeyboardButton( 105 | text=_["SA_B_5"], 106 | callback_data="TopOverall s", 107 | ), 108 | ] 109 | return InlineKeyboardMarkup( 110 | [ 111 | sudo if status else not_sudo, 112 | [ 113 | InlineKeyboardButton( 114 | text=_["CLOSE_BUTTON"], 115 | callback_data="close", 116 | ), 117 | ], 118 | ] 119 | ) 120 | 121 | 122 | def back_stats_buttons(_): 123 | return InlineKeyboardMarkup( 124 | [ 125 | [ 126 | InlineKeyboardButton( 127 | text=_["BACK_BUTTON"], 128 | callback_data="GETSTATS", 129 | ), 130 | InlineKeyboardButton( 131 | text=_["CLOSE_BUTTON"], 132 | callback_data="close", 133 | ), 134 | ], 135 | ] 136 | ) 137 | 138 | 139 | def top_ten_stats_markup(_): 140 | return InlineKeyboardMarkup( 141 | [ 142 | [ 143 | InlineKeyboardButton( 144 | text=_["SA_B_2"], 145 | callback_data="GetStatsNow Tracks", 146 | ), 147 | InlineKeyboardButton( 148 | text=_["SA_B_1"], 149 | callback_data="GetStatsNow Chats", 150 | ), 151 | ], 152 | [ 153 | InlineKeyboardButton( 154 | text=_["SA_B_3"], 155 | callback_data="GetStatsNow Users", 156 | ), 157 | InlineKeyboardButton( 158 | text=_["SA_B_4"], 159 | callback_data="GetStatsNow Here", 160 | ), 161 | ], 162 | [ 163 | InlineKeyboardButton( 164 | text=_["BACK_BUTTON"], 165 | callback_data="GlobalStats", 166 | ), 167 | InlineKeyboardButton( 168 | text=_["CLOSE_BUTTON"], 169 | callback_data="close", 170 | ), 171 | ], 172 | ] 173 | ) 174 | -------------------------------------------------------------------------------- /AlexaMusic/utils/inlinequery.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | from pyrogram.types import InlineQueryResultArticle, InputTextMessageContent 14 | 15 | answer = [ 16 | InlineQueryResultArticle( 17 | title="🙄 ᴩᴀᴜsᴇ 🙄", 18 | description="ᴩᴀᴜsᴇ ᴛʜᴇ ᴄᴜʀʀᴇɴᴛ ᴩʟᴀʏɪɴɢ sᴛʀᴇᴀᴍ ᴏɴ ᴠɪᴅᴇᴏᴄʜᴀᴛ.", 19 | thumb_url="https://telegra.ph/file/9006f077e6596772e5864.jpg", 20 | input_message_content=InputTextMessageContent("/pause"), 21 | ), 22 | InlineQueryResultArticle( 23 | title="😋 ʀᴇsᴜᴍᴇ 😋", 24 | description="ʀᴇsᴜᴍᴇ ᴛʜᴇ ᴩᴀᴜsᴇᴅ sᴛʀᴇᴀᴍ ᴏɴ ᴠɪᴅᴇᴏᴄʜᴀᴛ.", 25 | thumb_url="https://telegra.ph/file/9006f077e6596772e5864.jpg", 26 | input_message_content=InputTextMessageContent("/resume"), 27 | ), 28 | InlineQueryResultArticle( 29 | title="🙂 sᴋɪᴩ 🙂", 30 | description="sᴋɪᴩ ᴛʜᴇ ᴄᴜʀʀᴇɴᴛ ᴩʟᴀʏɪɴɢ sᴛʀᴇᴀᴍ ᴏɴ ᴠɪᴅᴇᴏᴄʜᴀᴛ ᴀɴᴅ ᴍᴏᴠᴇs ᴛᴏ ᴛʜᴇ ɴᴇxᴛ sᴛʀᴇᴀᴍ.", 31 | thumb_url="https://telegra.ph/file/9006f077e6596772e5864.jpg", 32 | input_message_content=InputTextMessageContent("/skip"), 33 | ), 34 | InlineQueryResultArticle( 35 | title="🥺 ᴇɴᴅ 🥺", 36 | description="ᴇɴᴅ ᴛʜᴇ ᴄᴜʀʀᴇɴᴛ ᴩʟᴀʏɪɴɢ sᴛʀᴇᴀᴍ ᴏɴ ᴠɪᴅᴇᴏᴄʜᴀᴛ.", 37 | thumb_url="https://telegra.ph/file/9006f077e6596772e5864.jpg", 38 | input_message_content=InputTextMessageContent("/end"), 39 | ), 40 | InlineQueryResultArticle( 41 | title="🥴 sʜᴜғғʟᴇ 🥴", 42 | description="sʜᴜғғʟᴇ ᴛʜᴇ ǫᴜᴇᴜᴇᴅ sᴏɴɢs ɪɴ ᴩʟᴀʏʟɪsᴛ.", 43 | thumb_url="https://telegra.ph/file/9006f077e6596772e5864.jpg", 44 | input_message_content=InputTextMessageContent("/shuffle"), 45 | ), 46 | InlineQueryResultArticle( 47 | title="🥱 ʟᴏᴏᴩ 🥱", 48 | description="ʟᴏᴏᴩ ᴛʜᴇ ᴄᴜʀʀᴇɴᴛ ᴩʟᴀʏɪɴɢ ᴛʀᴀᴄᴋ ᴏɴ ᴠɪᴅᴇᴏᴄʜᴀᴛ.", 49 | thumb_url="https://telegra.ph/file/9006f077e6596772e5864.jpg", 50 | input_message_content=InputTextMessageContent("/loop 3"), 51 | ), 52 | ] 53 | -------------------------------------------------------------------------------- /AlexaMusic/utils/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from pyrogram.enums import ParseMode 13 | 14 | from config import LOG_GROUP_ID 15 | from AlexaMusic.utils.database import is_on_off 16 | from AlexaMusic import app 17 | 18 | 19 | async def play_logs(message, streamtype): 20 | if await is_on_off(2): 21 | logger_text = f""" 22 | {app.mention} 𝖯𝗅𝖺𝗒 𝖫𝗈𝗀 23 | 24 | 𝖢𝗁𝖺𝗍 𝖨𝖣 : {message.chat.id} 25 | 𝖢𝗁𝖺𝗍 𝖭𝖺𝗆𝖾 : {message.chat.title} 26 | 𝖢𝗁𝖺𝗍 𝖴𝗌𝖾𝗋𝗇𝖺𝗆𝖾 : @{message.chat.username} 27 | 28 | 𝖴𝗌𝖾𝗋 𝖨𝖣 : {message.from_user.id} 29 | 𝖴𝗌𝖾𝗋 𝖭𝖺𝗆𝖾 : {message.from_user.mention} 30 | 𝖴𝗌𝖾𝗋𝗇𝖺𝗆𝖾 : @{message.from_user.username} 31 | 32 | 𝖰𝗎𝖾𝗋𝗒 : {message.text.split(None, 1)[1]} 33 | 𝖲𝗍𝗋𝖾𝖺𝗆-𝖳𝗒𝗉𝖾 : {streamtype}""" 34 | if message.chat.id != LOG_GROUP_ID: 35 | try: 36 | await app.send_message( 37 | chat_id=LOG_GROUP_ID, 38 | text=logger_text, 39 | parse_mode=ParseMode.HTML, 40 | disable_web_page_preview=True, 41 | ) 42 | except Exception: 43 | pass 44 | return 45 | -------------------------------------------------------------------------------- /AlexaMusic/utils/pastebin.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import aiohttp 14 | 15 | BASE = "https://batbin.me/" 16 | 17 | 18 | async def post(url: str, *args, **kwargs): 19 | async with aiohttp.ClientSession() as session: 20 | async with session.post(url, *args, **kwargs) as resp: 21 | try: 22 | data = await resp.json() 23 | except Exception: 24 | data = await resp.text() 25 | return data 26 | 27 | 28 | async def Alexabin(text): 29 | resp = await post(f"{BASE}api/v2/paste", data=text) 30 | if not resp["success"]: 31 | return 32 | return BASE + resp["message"] 33 | -------------------------------------------------------------------------------- /AlexaMusic/utils/stream/autoclear.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | import os 13 | 14 | import asyncio 15 | from config import autoclean 16 | 17 | 18 | async def auto_clean(popped): 19 | async def _auto_clean(popped_item): 20 | try: 21 | rem = popped_item.get("file") 22 | if rem: 23 | autoclean.discard(rem) 24 | if all(keyword not in rem for keyword in ("vid_", "live_", "index_")): 25 | try: 26 | os.remove(rem) 27 | except FileNotFoundError: 28 | pass 29 | except Exception: 30 | pass 31 | 32 | if isinstance(popped, dict): 33 | await _auto_clean(popped) 34 | elif isinstance(popped, list): 35 | await asyncio.gather(*(_auto_clean(pop) for pop in popped)) 36 | else: 37 | raise ValueError("Expected popped to be a dict or list.") 38 | -------------------------------------------------------------------------------- /AlexaMusic/utils/stream/queue.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | from typing import Union 13 | 14 | from config import autoclean, chatstats, userstats 15 | from config.config import time_to_seconds 16 | from AlexaMusic.misc import db 17 | 18 | 19 | async def put_queue( 20 | chat_id, 21 | original_chat_id, 22 | file, 23 | title, 24 | duration, 25 | user, 26 | vidid, 27 | user_id, 28 | stream, 29 | forceplay: Union[bool, str] = None, 30 | ): 31 | title = title.title() 32 | try: 33 | duration_in_seconds = time_to_seconds(duration) - 3 34 | except Exception: 35 | duration_in_seconds = 0 36 | put = { 37 | "title": title, 38 | "dur": duration, 39 | "streamtype": stream, 40 | "by": user, 41 | "chat_id": original_chat_id, 42 | "file": file, 43 | "vidid": vidid, 44 | "seconds": duration_in_seconds, 45 | "played": 0, 46 | } 47 | if forceplay: 48 | if check := db.get(chat_id): 49 | check.insert(0, put) 50 | else: 51 | db[chat_id] = [] 52 | db[chat_id].append(put) 53 | else: 54 | db[chat_id].append(put) 55 | autoclean.append(file) 56 | vidid = "telegram" if vidid == "soundcloud" else vidid 57 | to_append = {"vidid": vidid, "title": title} 58 | if chat_id not in chatstats: 59 | chatstats[chat_id] = [] 60 | chatstats[chat_id].append(to_append) 61 | if user_id not in userstats: 62 | userstats[user_id] = [] 63 | userstats[user_id].append(to_append) 64 | return 65 | 66 | 67 | async def put_queue_index( 68 | chat_id, 69 | original_chat_id, 70 | file, 71 | title, 72 | duration, 73 | user, 74 | vidid, 75 | stream, 76 | forceplay: Union[bool, str] = None, 77 | ): 78 | put = { 79 | "title": title, 80 | "dur": duration, 81 | "streamtype": stream, 82 | "by": user, 83 | "chat_id": original_chat_id, 84 | "file": file, 85 | "vidid": vidid, 86 | "seconds": 0, 87 | "played": 0, 88 | } 89 | if forceplay: 90 | if check := db.get(chat_id): 91 | check.insert(0, put) 92 | else: 93 | db[chat_id] = [] 94 | db[chat_id].append(put) 95 | else: 96 | db[chat_id].append(put) 97 | -------------------------------------------------------------------------------- /AlexaMusic/utils/sys.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | import time 14 | 15 | import psutil 16 | 17 | from AlexaMusic.misc import _boot_ 18 | 19 | from .formatters import get_readable_time 20 | 21 | 22 | async def bot_sys_stats(): 23 | bot_uptime = int(time.time() - _boot_) 24 | cpu = psutil.cpu_percent(interval=0.5) 25 | mem = psutil.virtual_memory().percent 26 | disk = psutil.disk_usage("/").percent 27 | UP = f"{get_readable_time((bot_uptime))}" 28 | CPU = f"{cpu}%" 29 | RAM = f"{mem}%" 30 | DISK = f"{disk}%" 31 | return UP, CPU, RAM, DISK 32 | -------------------------------------------------------------------------------- /AlexaMusic/utils/theme.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 by Alexa_Help @ Github, < https://github.com/TheTeamAlexa > 2 | # Subscribe On YT < Jankari Ki Duniya >. All rights reserved. © Alexa © Yukki. 3 | 4 | """ 5 | TheTeamAlexa is a project of Telegram bots with variety of purposes. 6 | Copyright (c) 2021 ~ Present Team Alexa 7 | 8 | This program is free software: you can redistribute it and can modify 9 | as you want or you can collabe if you have new ideas. 10 | """ 11 | 12 | 13 | # import random 14 | # from AlexaMusic.utils.database import get_theme 15 | 16 | # themes = [ 17 | # "alexa1", 18 | # "alexa2", 19 | # "alexa3", 20 | # "alexa4", 21 | # "alexa5", 22 | # "alexa6", 23 | # "alexa7", 24 | # "alexa8", 25 | # ] 26 | 27 | 28 | # async def check_theme(chat_id: int): 29 | # _theme = await get_theme(chat_id, "theme") 30 | # if not _theme: 31 | # theme = random.choice(themes) 32 | # else: 33 | # theme = _theme["theme"] 34 | # if theme == "Random": 35 | # theme = random.choice(themes) 36 | # return theme 37 | -------------------------------------------------------------------------------- /Backgrounds/Readme.md: -------------------------------------------------------------------------------- 1 | Finally, on March 7th, [@TheTeamAlexa](https://github.com/TheTeamAlexa) made random thumbnail picks for YouTube images to play songs on your Telegram Voice chat. This code originally belongs to (C) Team Yukki and was optimized by Anonymous. Make sure to star all projects when you try to modify them. You can join our group below. Thank you for using Alexa Music. 2 |
3 | sᴜᴘᴘᴏʀᴛ 4 |
5 | 6 | # ❤️ Support< 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /Backgrounds/alexa1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa1.PNG -------------------------------------------------------------------------------- /Backgrounds/alexa2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa2.PNG -------------------------------------------------------------------------------- /Backgrounds/alexa3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa3.PNG -------------------------------------------------------------------------------- /Backgrounds/alexa4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa4.PNG -------------------------------------------------------------------------------- /Backgrounds/alexa5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa5.PNG -------------------------------------------------------------------------------- /Backgrounds/alexa6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa6.PNG -------------------------------------------------------------------------------- /Backgrounds/alexa7.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa7.PNG -------------------------------------------------------------------------------- /Backgrounds/alexa8.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/Backgrounds/alexa8.PNG -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.12-bookworm 2 | 3 | # Update, upgrade, install dependencies, and clean up in one layer 4 | RUN apt-get update -y && \ 5 | apt-get upgrade -y && \ 6 | apt-get install -y --no-install-recommends ffmpeg git && \ 7 | apt-get clean && \ 8 | rm -rf /var/lib/apt/lists/* 9 | 10 | # Set the working directory and copy application files 11 | WORKDIR /app 12 | COPY . . 13 | 14 | # Install Python dependencies without cache 15 | RUN pip3 install --no-cache-dir --upgrade -r requirements.txt 16 | 17 | # Start the application using gunicorn and the Python script concurrently. 18 | CMD gunicorn app:app & bash start 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | AlexaMusic License Agreement 2 | 3 | Copyright (c) 2025 AlexaMusic. All rights reserved. 4 | 5 | 1. Grant of License: 6 | This software is licensed, not sold. You are granted a non-exclusive, non-transferable, and revocable license to use the software for personal, non-commercial purposes. 7 | 8 | 2. Restrictions: 9 | - You may not distribute, copy, modify, or reverse-engineer the software. 10 | - Commercial use of this software is strictly prohibited without prior written permission. 11 | 12 | 3. Ownership: 13 | All intellectual property rights in this software remain the sole property of TheTeamAlexa. 14 | 15 | 4. Warranty Disclaimer: 16 | This software is provided "as is," without warranty of any kind. TheTeamAlexa is not liable for any damages arising from the use of this software. 17 | 18 | 5. Termination: 19 | This license is effective until terminated. It will terminate automatically if you fail to comply with any of its terms. 20 | 21 | By using this software, you agree to the terms outlined above. 22 | 23 | TheTeamAlexa[https://github.com/TheTeamAlexa] 24 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker: bash start -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Alexa Music", 3 | "description": "Telegram streaming bot with some useful features, written in Python. Supporting platforms like Youtube, Spotify, Resso, AppleMusic, Soundcloud and M3u8 Links.", 4 | "logo": "https://telegra.ph/file/ba967503682a55beaedd3.png", 5 | "keywords": [ 6 | "python", 7 | "python3", 8 | "telegram", 9 | "bot", 10 | "Alexa", 11 | "alexamusic", 12 | "alexamusicbot", 13 | "pytgcalls", 14 | "ntgcalls", 15 | "py-tgcalls", 16 | "kurigram", 17 | "pyrogram" 18 | ], 19 | "env": { 20 | "API_ID": { 21 | "description": "Get this value from https://my.telegram.org", 22 | "value": "", 23 | "required": true 24 | }, 25 | "API_HASH": { 26 | "description": "Get this value from https://my.telegram.org", 27 | "value": "", 28 | "required": true 29 | }, 30 | "BOT_TOKEN": { 31 | "description": "A Bot's token from Botfather", 32 | "value": "", 33 | "required": true 34 | }, 35 | "OWNER_ID": { 36 | "description": "The user id(s) of user(s) whom you would like to add as a OWNER. Multiple values shall be seperated with a space.", 37 | "value": "5303133436", 38 | "required": true 39 | }, 40 | "MONGO_DB_URI": { 41 | "description": "Mongo DB URL", 42 | "value": "", 43 | "required": true 44 | }, 45 | "MUSIC_BOT_NAME": { 46 | "description": "A name for your Music Bot.", 47 | "value": "", 48 | "required": true 49 | }, 50 | "STRING_SESSION": { 51 | "description": "A Pyrogram Session Get It From Here @Session_Generator_Robot.", 52 | "value": "", 53 | "required": true 54 | }, 55 | "HEROKU_API_KEY": { 56 | "description": "Your Heroku account's API key", 57 | "value": "", 58 | "required": true 59 | }, 60 | "HEROKU_APP_NAME": { 61 | "description": "Your heroku app name", 62 | "value": "", 63 | "required": true 64 | }, 65 | "UPSTREAM_REPO": { 66 | "description": "If you dont know this, Leave as it is", 67 | "value": "https://github.com/TheTeamAlexa/AlexaMusic", 68 | "required": false 69 | }, 70 | "LOG_GROUP_ID": { 71 | "description": "Your Log Group ID, add your bot and promote as an admin with full rights!. Use only Group. Please don't use Channel ID.", 72 | "value": "", 73 | "required": true 74 | }, 75 | "COOKIES": { 76 | "description": "Paste your batbin link.", 77 | "value": "https://batbin.me/raw/", 78 | "required": true 79 | } 80 | }, 81 | "buildpacks": [ 82 | { 83 | "url": "heroku/python" 84 | }, 85 | { 86 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git" 87 | } 88 | ], 89 | "stack": "container" 90 | } -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route("/") 7 | def hello_world(): 8 | return "TeamAlexa" 9 | 10 | 11 | if __name__ == "__main__": 12 | app.run() 13 | -------------------------------------------------------------------------------- /assets/Audio.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Audio.jpeg -------------------------------------------------------------------------------- /assets/Global.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Global.jpeg -------------------------------------------------------------------------------- /assets/Ping.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Ping.jpeg -------------------------------------------------------------------------------- /assets/Playlist.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Playlist.jpeg -------------------------------------------------------------------------------- /assets/Soundcloud.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Soundcloud.jpeg -------------------------------------------------------------------------------- /assets/SpotifyAlbum.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/SpotifyAlbum.jpeg -------------------------------------------------------------------------------- /assets/SpotifyArtist.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/SpotifyArtist.jpeg -------------------------------------------------------------------------------- /assets/SpotifyPlaylist.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/SpotifyPlaylist.jpeg -------------------------------------------------------------------------------- /assets/Stats.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Stats.jpeg -------------------------------------------------------------------------------- /assets/Stream.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Stream.jpeg -------------------------------------------------------------------------------- /assets/Video.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Video.jpeg -------------------------------------------------------------------------------- /assets/Youtube.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/Youtube.jpeg -------------------------------------------------------------------------------- /assets/font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/font.ttf -------------------------------------------------------------------------------- /assets/font2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheTeamAlexa/AlexaMusic/4871c4cf09e00ea3c94f868ac797febdde3aa30f/assets/font2.ttf -------------------------------------------------------------------------------- /assets/readme.md: -------------------------------------------------------------------------------- 1 | ## Alexa Music Assets Folder 2 | 3 | # Contains all the fonts and thumb related files. 4 | 5 | ```console 6 | font.ttf & font2.ttf - Font File for Thumbnails Generation 7 | ``` 8 | - > If you want can change your font for thumbnails , change these files from here. 9 | 10 | ```console 11 | Audio.jpeg - Thumbnail Image to be send when someone plays Audio files from telegram. 12 | ``` 13 | - > If you want to change thumb images, make sure your name file "Audio.jpeg" remains same or alternatively you can add a var

`TELEGRAM_AUDIO_URL` - Use telegraph link 14 | 15 | 16 | ```console 17 | Video.jpeg - Thumbnail Image to be send when someone plays Video files from telegram. 18 | ``` 19 | - > If you want to change thumb images, make sure your file name "Video.jpeg" remains same or alternatively you can add a var

`TELEGRAM_VIDEO_URL` - Use telegraph link 20 | 21 | 22 | ```console 23 | Stream.jpeg - Thumbnail Image to be send when someone plays M3u8 or live links on music bot. 24 | ``` 25 | - > If you want to change thumb images, make sure your file name "Stream.jpeg" remains same or alternatively you can add a var

`STREAM_IMG_URL` - Use telegraph link 26 | 27 | ```console 28 | Soundcloud.jpeg - Thumbnail Image to be when send someone plays music from soundcloud. 29 | ``` 30 | - > If you want to change thumb images, make sure your file name "Soundcloud.jpeg" remains same or alternatively you can add a var

`SOUNCLOUD_IMG_URL` - Use telegraph link 31 | 32 | ```console 33 | Youtube.jpeg - If Thumbnail Generator fails anyhow then bot will send this image 34 | ``` 35 | - > If you want to change thumb images, make sure your file name "Youtube.jpeg" remains same or alternatively you can add a var

`YOUTUBE_IMG_URL` - Use telegraph link 36 | 37 | ```console 38 | Ping.jpeg - This image is going to be used by /ping command 39 | ``` 40 | - > If you want to change ping image, make sure your file name "Ping.jpeg" remains same or alternatively you can add a var

`PING_IMG_URL` - Use telegraph link 41 | 42 | 43 | ```console 44 | Playlist.jpeg - This image is going to be used by /play command 45 | ``` 46 | - > If you want to change playlist image, make sure your file name "Playlist.jpeg" remains same or alternatively you can add a var

`PLAYLIST_IMG_URL` - Use telegraph link 47 | 48 | 49 | ```console 50 | Global.jpeg and Stats.jpeg - This image is going to be used by /stats command 51 | ``` 52 | - > If you want to change stats images, make sure your file name "Global.jpeg" or "Stats.jpeg" remains same or alternatively you can add a var

`GLOBAL_IMG_URL` - Use telegraph link
`STATS_IMG_URL` - Use telegraph link 53 | 54 | 55 | ```console 56 | SpotifyAlbum.jpeg , SpotifyArtist.jpeg and SpotifyPlaylist.jpeg - This image is going to be used by spotify inline command 57 | ``` 58 | - > If you want to change stats images, make sure your file name "SpotifyAlbum.jpeg", "SpotifyPlaylist.jpeg" or "SpotifyArtist.jpeg" remains same or alternatively you can add a var

`SPOTIFY_ARTIST_IMG_URL` - Use telegraph link
`SPOTIFY_ALBUM_IMG_URL` - Use telegraph link
`SPOTIFY_PLAYLIST_IMG_URL` - Use telegraph link 59 | -------------------------------------------------------------------------------- /config/__init__.py: -------------------------------------------------------------------------------- 1 | from .config import * 2 | -------------------------------------------------------------------------------- /cookies/README.md: -------------------------------------------------------------------------------- 1 | ## **Using Cookies** 2 | 3 | To Authenticate Requests Using Cookies, follow these Steps: 4 | 5 | #### **1. Export Cookies in Netscape Format** 6 | Use a browser extension to export cookies in the **Netscape HTTP Cookie File** format: 7 | 8 | - **Firefox:** [Get cookies.txt (Firefox Add-on)](https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/) 9 | - **Chrome:** [Get cookies.txt (Chrome Extension)](https://chromewebstore.google.com/detail/get-cookiestxt-clean/ahmnmhfbokciafffnknlekllgcnafnie) 10 | 11 | #### **2. Upload Cookies to BatBin** 12 | 1. Go to **[BatBin](https://batbin.me)**. 13 | 2. Paste your `cookies.txt`. 14 | 3. Copy the generated URL. 15 | 16 | #### **3. Configure the Environment Variable** 17 | Paste the BatBin URL into your `COOKIES` environment variable. 18 | -------------------------------------------------------------------------------- /cookies/cookies.txt: -------------------------------------------------------------------------------- 1 | # Dont Paste or Change Anything Here. -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.10" 2 | services: 3 | worker: 4 | build: . 5 | environment: 6 | AUTO_LEAVING_ASSISTANT: $AUTO_LEAVING_ASSISTANT # true 7 | BOT_TOKEN: $BOT_TOKEN # true 8 | MONGO_DB_URI: $MONGO_DB_URI # true 9 | API_ID: $API_ID # true 10 | API_HASH: $API_HASH # true 11 | MUSIC_BOT_NAME: $MUSIC_BOT_NAME # true 12 | OWNER_ID: $OWNER_ID # true 13 | HEROKU_API_KEY: $HEROKU_API_KEY #default to none 14 | HEROKU_APP_NAME: $HEROKU_APP_NAME # defaults to None 15 | LOG_GROUP_ID: $LOG_GROUP_ID # true 16 | SUPPORT_GROUP: $SUPPORT_GROUP # false 17 | SUPPORT_CHANNEL: $SUPPORT_CHANNEL # false 18 | START_IMG_URL: $START_IMG_URL # true 19 | UPSTREAM_REPO: $UPSTREAM_REPO # true 20 | UPSTREAM_BRANCH: $UPSTREAM_BRANCH # true 21 | STRING_SESSION: $STRING_SESSION # true 22 | STRING_SESSION2: $STRING_SESSION2 # true 23 | SUDO_USERS: $SUDO_USERS #false 24 | BOT_ID: $BOT_ID # true 25 | -------------------------------------------------------------------------------- /genstring.py: -------------------------------------------------------------------------------- 1 | # Credits to Pranav 2 | 3 | 4 | import asyncio 5 | from pyrogram import Client 6 | 7 | 8 | async def generate_and_send_string_session(api_id, api_hash): 9 | async with Client("my_account", api_id=api_id, api_hash=api_hash) as app: 10 | string_session = await app.export_session_string() 11 | await app.send_message( 12 | "me", 13 | f"Your Pyrogram String Session:\n\n{string_session}", 14 | ) 15 | print("String session has been sent to your 'Saved Messages'.") 16 | 17 | 18 | if __name__ == "__main__": 19 | api_id = int(input("Enter your API ID: ")) 20 | api_hash = input("Enter your API Hash: ") 21 | asyncio.run(generate_and_send_string_session(api_id, api_hash)) 22 | -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | worker: Dockerfile 4 | run: 5 | worker: bash start -------------------------------------------------------------------------------- /koyeb.yaml: -------------------------------------------------------------------------------- 1 | name: AlexaMusic 2 | type: app 3 | docker: 4 | file: Dockerfile 5 | build_command: pip3 install --no-cache-dir --upgrade --requirement requirements.txt 6 | run_command: bash start 7 | env: [] 8 | -------------------------------------------------------------------------------- /render.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | - type: web 3 | name: AlexaMusic 4 | env: python 5 | plan: free 6 | buildCommand: pip3 install --no-cache-dir --upgrade --requirement requirements.txt 7 | startCommand: bash start 8 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | aiofiles 2 | aiohttp 3 | beautifulsoup4 4 | Flask 5 | gitpython 6 | gunicorn 7 | hachoir 8 | heroku3 9 | lyricsgenius 10 | motor 11 | ntgcalls==2.0.1 12 | pillow 13 | psutil 14 | py-tgcalls==2.2.0rc3 15 | pykeyboard 16 | Kurigram 17 | python-dotenv 18 | requests 19 | speedtest-cli 20 | spotipy 21 | PyTgCrypto 22 | unidecode 23 | werkzeug 24 | yt-dlp~=2025.5.22 25 | https://github.com/KSKOP69/youtube-search-python/archive/ksk.zip 26 | pyyaml~=6.0.2 27 | -------------------------------------------------------------------------------- /sample.env: -------------------------------------------------------------------------------- 1 | API_ID= # get this value from my.telegram.org 2 | API_HASH= # get this value from my.telegram.org 3 | BOT_TOKEN= # get this value from @Botfather 4 | OWNER_ID= # get owner id 5 | MONGO_DB_URI= # get this value from mongodb.com 6 | LOG_GROUP_ID= # get this value from in your log group 7 | MUSIC_BOT_NAME= # your music bot name 8 | STRING_SESSION= # pyrogram string session 9 | COOKIES= # Batbin link -------------------------------------------------------------------------------- /start: -------------------------------------------------------------------------------- 1 | python3 -m AlexaMusic -------------------------------------------------------------------------------- /strings/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021-2022 by Alexa_Help@Github, < https://github.com/Jankarikiduniya >. 3 | # A Powerful Music Bot Property Of Rocks Indian Largest Chatting Group 4 | 5 | # Kanged By © @Dr_Asad_Ali 6 | # Rocks © @Shayri_Music_Lovers 7 | # Owner Asad Ali 8 | # Harshit Sharma 9 | # All rights reserved. © Alisha © Alexa © Yukki 10 | 11 | 12 | import os 13 | from typing import List 14 | 15 | import yaml 16 | 17 | languages = {} 18 | commands = {} 19 | 20 | 21 | def get_command(value: str) -> List: 22 | return commands["command"][value] 23 | 24 | 25 | def get_string(lang: str): 26 | return languages[lang] 27 | 28 | 29 | for filename in os.listdir(r"./strings"): 30 | if filename.endswith(".yml"): 31 | language_name = filename[:-4] 32 | commands[language_name] = yaml.safe_load( 33 | open(f"./strings/{filename}", encoding="utf8") 34 | ) 35 | 36 | 37 | for filename in os.listdir(r"./strings/langs/"): 38 | if "en" not in languages: 39 | languages["en"] = yaml.safe_load( 40 | open(r"./strings/langs/en.yml", encoding="utf8") 41 | ) 42 | if filename.endswith(".yml"): 43 | language_name = filename[:-4] 44 | if language_name == "en": 45 | continue 46 | languages[language_name] = yaml.safe_load( 47 | open(f"./strings/langs/{filename}", encoding="utf8") 48 | ) 49 | for item in languages["en"]: 50 | if item not in languages[language_name]: 51 | languages[language_name][item] = languages["en"][item] 52 | -------------------------------------------------------------------------------- /strings/command.yml: -------------------------------------------------------------------------------- 1 | # Bot Commands 2 | PING_COMMAND : ["ping"] 3 | START_COMMAND : ["start"] 4 | HELP_COMMAND : ["help"] 5 | SETTINGS_COMMAND : ["settings", "setting"] 6 | RELOAD_COMMAND : ["admincache", "reload"] 7 | GSTATS_COMMAND : ["gstats"] 8 | STATS_COMMAND : ["stats"] 9 | LANGUAGE_COMMAND : ["lang", "language", "langs"] 10 | 11 | # Play Commands 12 | PLAY_COMMAND : ["play", "fuck", "vplay", "cplay", "cvplay", "playforce", "vplayforce", "cplayforce", "cvplayforce"] 13 | PLAYMODE_COMMAND : ["playmode"] 14 | CHANNELPLAY_COMMAND : ["channelplay"] 15 | STREAM_COMMAND : ["stream", "cstream", "streamforce"] 16 | 17 | #Playlists Command 18 | PLAYLIST_COMMAND : ["playlist"] 19 | DELETEPLAYLIST_COMMAND : ["deleteplaylist"] 20 | 21 | 22 | # Tools 23 | QUEUE_COMMAND : ["queue","cqueue", "player", "cplayer", "playing", "cplaying"] 24 | SONG_COMMAND : ["song", "video", "vsong"] 25 | LYRICS_COMMAND : ["lyrics"] 26 | 27 | 28 | # Admin Commands 29 | AUTH_COMMAND : ["auth"] 30 | UNAUTH_COMMAND : ["unauth"] 31 | AUTHUSERS_COMMAND : ["authusers"] 32 | PAUSE_COMMAND : ["pause", "cpause"] 33 | RESUME_COMMAND : ["resume", "cresume"] 34 | MUTE_COMMAND : ["mute", "cmute"] 35 | UNMUTE_COMMAND : ["unmute", "cunmute"] 36 | STOP_COMMAND : ["stop", "end", "cstop", "cend"] 37 | SKIP_COMMAND : ["skip", "cskip"] 38 | SHUFFLE_COMMAND : ["shuffle", "cshuffle"] 39 | LOOP_COMMAND : ["loop", "cloop"] 40 | SEEK_COMMAND : ["seek", "cseek", "seekback", "cseekback"] 41 | RESTART_COMMAND : ["reboot"] 42 | 43 | # Sudo Users Commaands 44 | 45 | # Sudo Command 46 | ADDSUDO_COMMAND : ["addsudo"] 47 | DELSUDO_COMMAND : ["delsudo", "rmsudo"] 48 | SUDOUSERS_COMMAND : ["sudolist", "listsudo"] 49 | 50 | #Broadcast 51 | BROADCAST_COMMAND : ["broadcast", "gcast"] 52 | 53 | #Blacklist chat 54 | BLACKLISTCHAT_COMMAND : ["blacklistchat", "blchat"] 55 | WHITELISTCHAT_COMMAND : ["whitelistchat", "unblchat"] 56 | BLACKLISTEDCHAT_COMMAND : ["blacklistedchat"] 57 | 58 | # Video Calls Command 59 | VIDEOLIMIT_COMMAND : ["set_video_limit"] 60 | VIDEOMODE_COMMAND : ["videomode"] 61 | 62 | #Mantenance 63 | MAINTENANCE_COMMAND : ["maintenance"] 64 | LOGGER_COMMAND : ["logger"] 65 | 66 | #Heroku 67 | GETLOG_COMMAND : ["get_log", "logs", "getlog", "log"] 68 | GETVAR_COMMAND : ["get_var", "getvar", "showvar"] 69 | DELVAR_COMMAND : ["del_var", "delvar"] 70 | SETVAR_COMMAND : ["set_var", "setvar", "addvar"] 71 | USAGE_COMMAND : ["usage"] 72 | VARS_COMMAND : ["vars", "config"] 73 | 74 | 75 | #Basic Bot Commands 76 | UPDATE_COMMAND : ["update"] 77 | REBOOT_COMMAND : ["restart"] 78 | AUTOEND_COMMAND : ["autoend"] 79 | 80 | #Private Bot Mode 81 | AUTHORIZE_COMMAND : ["authorize"] 82 | UNAUTHORIZE_COMMAND : ["unauthorize"] 83 | AUTHORIZED_COMMAND : ["authorized"] 84 | 85 | #Block Users Command 86 | BLOCK_COMMAND : ["block"] 87 | UNBLOCK_COMMAND : ["unblock"] 88 | BLOCKED_COMMAND : ["blockedusers"] 89 | 90 | #sPEEDTEST 91 | SPEEDTEST_COMMAND : ["speedtest"] 92 | 93 | #Voice chat commands 94 | ACTIVEVC_COMMAND : ["activevoice", "activevc"] 95 | ACTIVEVIDEO_COMMAND : ["activevideo", "activev"] 96 | 97 | #Gban Commands 98 | GBAN_COMMAND : ["gban"] 99 | UNGBAN_COMMAND : ["ungban"] 100 | GBANNED_COMMAND : ["gbannedusers"] 101 | --------------------------------------------------------------------------------