Music Genre Role Bot is a Discord bot that allows users to set and view music genre roles based on YouTube song URLs. The bot uses the Spotify API to determine the genre of a song and then creates and assigns a corresponding role to the user. It also provides the ability to view all users with a specific genre role.
- Set Genre Role: Users can set their genre role based on the genre of a song they provide. The bot determines the genre by using the Spotify API and YouTube-DL.
- Get Users with Role: Users can see all members with a specific genre role.
The bot uses Discord's slash commands for easy interaction. The following commands are available:
/set-genre-role [song_url]
: Set the user's genre role based on the genre of the provided YouTube song URL. The bot will search for the song on Spotify, determine its genre, and create/assign a role to the user based on the genre./get-users-with-role [genre]
: View all members in the server with the specified genre role. The bot will display an embed listing all users with the role.
discord.py
: Discord API wrapper for Python.spotipy
: Lightweight Python library for the Spotify Web API.yt-dlp
: A powerful command-line program to download videos from YouTube and other video hosting sites.
- Install the required dependencies.
- Set up the necessary environment variables for the bot, including the Discord bot token, Spotify client ID, and Spotify client secret.
- Run the bot script.
- Invite the bot to your Discord server.
- Use the slash commands to interact with the bot.
- Enjoy setting and viewing genre roles based on your favorite songs!