{"id":16419624,"url":"https://github.com/foo290/resonate-beats","last_synced_at":"2025-02-24T13:41:22.907Z","repository":{"id":123397497,"uuid":"311985850","full_name":"foo290/resonate-beats","owner":"foo290","description":"resonate-beats is a Discord COG file that can be added to any discord bot to add superb music streaming functionality to the existing bot.","archived":false,"fork":false,"pushed_at":"2020-12-24T03:57:19.000Z","size":35562,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T21:47:34.978Z","etag":null,"topics":["cog","discord","discord-bot","discord-cog","discord-cogs","discord-py","discord-python","music-bot","music-bot-discord","music-streaming","music-streaming-bot","music-streaming-functionality","python","resonate-beats"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foo290.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-11T13:55:10.000Z","updated_at":"2023-07-22T03:40:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"142e0f5f-9930-4465-87bf-0ec94df0ff59","html_url":"https://github.com/foo290/resonate-beats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foo290%2Fresonate-beats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foo290%2Fresonate-beats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foo290%2Fresonate-beats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foo290%2Fresonate-beats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foo290","download_url":"https://codeload.github.com/foo290/resonate-beats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240491574,"owners_count":19809977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cog","discord","discord-bot","discord-cog","discord-cogs","discord-py","discord-python","music-bot","music-bot-discord","music-streaming","music-streaming-bot","music-streaming-functionality","python","resonate-beats"],"created_at":"2024-10-11T07:25:22.101Z","updated_at":"2025-02-24T13:41:22.876Z","avatar_url":"https://github.com/foo290.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## UPCOMING FEATURE...\nMake your playlist by adding songs and reacting on currently playing songs using simple commands.\n\nplay your playlist / add your playlist in current playlist by simple commands...\n\n\u003cp align='center'\u003e\n\u003cimg src='https://github.com/foo290/resonate-beats/blob/main/readme_imgs/resonate-beats-logo.png' width=180px, alt='an image was supposed to be here'\u003e\n\u003c/p\u003e\n\u003ch1 align='center', style='font-size:30px'\u003e\u003cb\u003e resonate-beats\u003c/b\u003e 🎵\u003c/h1\u003e\n\n\u003cp align='center'\u003e\n\u003cimg src='https://github.com/foo290/resonate-beats/blob/main/readme_imgs/panda-rb.jpg' alt='an image was supposed to be here'\u003e\n\u003c/p\u003e\n\nresonate-beats is a Discord COG file that can be added to any discord bot to add superb music streaming functionality to the existing bot.\n\n\n\n\n## Setup\n\n### 1. Dependencies :\n\nEverything you need to run this player is defined in requirements.txt.\n\n\n### 2. Directory and files setup :\n\nThere is an extension file in COG directory named musiccog.py, add that file to your existing cog directory and the add \"resonate_utils\" directory to same directory as musiccog. So if your current setup should look like this : \n\n```\n├── COGs\n│   ├── __init__.py\n│   ├── musiccog.py  ----\u003e Music cog file\n|   |__ ...\n│   └── resonate_utils   ----\u003e resonate_utils directory \n│       ├── __init__.py\n│       ├── custom_exceptions.py\n│       ├── decorators.py\n|       |__ ...\n\n```\n\n\u003cb\u003eNOTE : \u003c/b\u003e```musiccog.py``` and ```resonate_utils``` must be in same directory as the ```musiccog.py``` file contains relative imports from ```resonate_utils``` dir, If your project needs to change the location of resonate utiils then change the relative imports to absolute imports.\n\nOnce your directory setup is complete, load the cog/extension in your bot by the method you are using to load COGs in your bot.\nThe musiccog contains a built in logger so you will know it the file has been loaded successfully as it will print status to the STDOUT.\n\n### 3. Server setup :\n\u003cb\u003eThe server and configuration used in this project is provided in ```server``` directory exactly for cloud server setup.\u003c/b\u003e (I used heroku for testing.)\n\nThe server configs are configured in ```application.yml``` file.\n\nThis project uses lavalink server to stream music which can be downloaded \u003ca href='https://github.com/Frederikam/Lavalink/releases'\u003ehere\u003c/a\u003e.\n\nOnce you download the server ```Lavalink.jar``` file, to test it locally, run command in your terminal :\n\n```\n\u003e\u003e\u003e java -jar Lavalink.jar\n```\n\nThis will start the server at your local machine. To connect it locally or remotely, set \u003ca href='#serverconfigs'\u003ethese configurations\u003c/a\u003e in ```resonate_settings.py``` file.\n\n# Commands\n\nJoin the voice channel and run ```\u003cyour_prefix\u003ejoin``` command to connect bot. The bot will join the voice channel in which the command invoker currently in, if no voice channel is found, the bot will show relevant message. \n\nEvery command must be followed by yout command prefix like : ```\u003ccommand_prefix\u003ecommand```.\n\n\n|  Command Name |  Command Alias |          Command Parameters          |                 Command Action                    |                 Extra note                  |\n|---------------|----------------|--------------------------------------|---------------------------------------------------|---------------------------------------------|\n| connect       |    join        |            channel name(Optional)    | connect the bot to the voice channel              | Command invoker should be in voice channel  |\n| play          |         p      | song_name/song_link/playlist_link    | Searches for the given params, will ask for the songs found and add that to the playlist.         | Resumes the playerif it is paused.|\n| stop          |      s         |            None                      | Stops the player and clears the current playlist. |         None                                |\n| pause         |     ps         |            None                      | Pauses the player.                                | To resume the player, use play command without params.|\n| playlist      |       pl       | int (2,3,4...) Page no. of playlist  | The playlist shows limited songs by default, to traverse between all the songs, use pl command with an integer specifying the page you want to fetch  |                      None                       |\n| remove        |          rm    | int (1,2,3...) Index no. of the song you want to remove. | Every song has an index in playlist. You can remove any song simply by number which is shown in playlist |  None |\n| information   |      info      |                None                  | Shows raw information of current player config like pointer, total songs, volume etc.  |  None  |\n| volume        |       v        | int (10,14,...any)                   | Sets the volume of current player to the given param| If no param is passed, then displays the current volume level |\n| seek          |           sk   |      int (0-9)                       | seeks the song. Every song is scaled on scale of 10, pass any int in range 0-9 and player will autotically seek playback to specific interval based on song length   |                           None              |\n| next          |      +1        |      None                            | Plays next song in playlist if available          |   None |\n| previous      |      -1        |      None                            | Plays previous song in playlist if available          |   None |\n\n\n\u003ch1 align='center'\u003eCustomize your music player\u003c/h1\u003e\n\nEvery setting of music player is defined in ```resonate_setting.py``` module. There is a data class holding all the important variables which you can customize according to your preferences.\n\n## 1. Customizing the command aliases :\n\nIn ```resonate_settings.py```, there is a dict named ```CMD_ALIASES``` which holds all the available commands and their corresponding aliases as a list. you can define more than one aliases for one command (obviously...), keeping them unique for each command. \n\n\u003cbr\u003e\nHere is the snapshot of that dict representing how it is defined...\n\n```\nCMD_ALIASES = {\n    'connect': [    ----\u003e Original command\n        'join',     ----\u003e Alias\n    ],              ----\u003e A list of aliases\n    'leave': [              ...\n      'lv'\n    ],\n    'play': [\n        'p',\n    ],\n    'stop': [\n        's',\n    ],\n    'next': [\n        '+1',\n    ],\n    \n    ...\n```\n\n## 2. Enforcing music commands\n\nUnlike all the commands of your bot, you may want to enforce music commands to a specific channel. This can be done by simply changing a variable ```RESTRICT_CMDS_TO_MUSIC_CHANNEL``` to ```True``` in ```resonate_settings.py``` inside the dataclass Config.\n\n### If set to False (Default is False):\nIf this is set to ```False```, then music commands can be used from any channel of your server.\n\n### If set to True :\nIf this is set to true then music commands will only be accessible from the provided channel. \nIf set to ```True```, then  you also have to provide the id of the channel you want to use as music commands channel. To do this, set the variable ```MUSIC_CMD_CHANNEL``` to the channel id. for ex:\n\n```\nMUSIC_CMD_CHANNEL: int = 785846xxxxx\n```\n\n## 3. Player Volume :\nA default volume is set to level : 50 when the player starts(which can be changed by command \"v\" later. If you want the default volume to something else, change the variable ```DEFAULT_VOLUME``` to desired value. \n\nThe maximum limit of player is level 1000 but at that level, you'll be listening to ```zombies (not clear at all)```. \n\nTo avoid the unpleasant experiance by setting the volume more than 100, maximum value is defined as ```MAX_VOLUME: int = 100```. \nBut again, you are free to listen to the zombies by changing this variable in Config dataclass.\n\n## 4. Logging :\nThe COG file comes with its prebuilt customized logger class which sits in ```resonate_utils``` directory as ```logger.py```. This will keep you updated for every event happening in your player.\n\nTo write the logs to a file, define the file location as variable ```LOG_FILE``` and set variable ```WRITE_LOGS``` as ```True``` in the ```resonate_settings.py``` . Default is set to ```LOG_FILE: str = \"logs/music.log\"```.\n\nThis logger also pukes the logs in STDOUT/console, if you dont want this behaviour, then set variable ```STDOUT_LOGS``` to ```False```.\n\n\u003cp id='serverconfigs'\u003e\n\u003ch2\u003e5. Server configs :\u003c/h2\u003e\n\nAn ```application.yml``` file holds all the internal configuration for server. (provided in server directory)\n\n### Localhost configs :\n\nInside the Config dataclass in ```resonate_settings.py``` :\n\n```\nMUSIC_HOST: str = \"127.0.0.1\"\nMUSIC_PORT: int = 2333\nREST_URI: str = \"http://127.0.0.1:2333\"\nMUSIC_SERVER_PW: str = os.environ.get('MUSIC_SERVER_PW') ----\u003e set this environment variable for password (recommended).\nMUSIC_SERVER_REGION: str = \"your region\"\n```\n\n### Cloud configs :\n\nYou must be hosting a lavalink server for this project (obviously), here is how you can define and set its configurations in the code:\n\nInside the Config dataclass in ```resonate_settings.py``` :\n\n```\nMUSIC_HOST: str = \"Host name here\"\nMUSIC_PORT: int = 80\nREST_URI: str = \"Host uri here\"\nMUSIC_SERVER_PW: str = os.environ.get('MUSIC_SERVER_PW') ----\u003e set this environment variable for password (recommended).\nMUSIC_SERVER_REGION: str = \"your region\"\n```\n\u003c/p\u003e\n\n\n\u003cp align='center'\u003e\n\u003cimg src='https://github.com/foo290/resonate-beats/blob/main/readme_imgs/rb%2Bdc.png' alt='an image was supposed to be here'\u003e\n\u003c/p\u003e\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoo290%2Fresonate-beats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoo290%2Fresonate-beats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoo290%2Fresonate-beats/lists"}