A simple discord bot that plays youtube videos in a voice channel.
- The bot does support multiple servers with their own queue.
- However, the audio quality dropped when the bot is playing in multiple servers.
- I believe, this is due to the fact that the bot is using the same ffmpeg process to play the audio in multiple servers.
- I will try to fix this issue in the future when I feel like it.
- For now, it's recommended to spin up one bot container for each server.
You must be in a voice channel to use the bot.
!gosing {youtube_url}
to add a song to the queue!gosing-queue
to display the queue!gosing-leave
to clear the queue and leave the voice channel!gosing-skip
to skip the current song!gosing-pause
to pause the current song!gosing-resume
to resume the current song!gosing-loop-one
to loop the current song!gosing-loop-all
to loop the entire queue!gosing-loop
to toggle the loop mode
- Go to https://discord.com/developers/applications
- Click on "New Application"
- Give it a name
- Select your newly created application
- Click on "Bot" in the left menu
- Click on "Add Bot"
- Click on "Copy" under "Token" and save it somewhere
- Go to Oauth2 > URL Generator (https://discord.com/developers/applications/{yourappid}/oauth2/url-generator)
- Select "bot" in the "scopes" section
- Select the permissions you want your bot to have in the "bot permissions" section
- The required permissions are "Send Messages", "Read Message History", "Manage Messages", "Add Reactions", "Connect", "Speak", "Use Voice Activity"
- Copy the generated link and paste it in your browser
- Select the server you want to invite your bot to
- Click on "Continue"
- Click on "Authorize"
- Go to https://console.developers.google.com/
- Click on "Create Project"
- Give it a name
- Click on "Create"
- Click on "Enable APIs and Services"
- Search for "Youtube Data API v3"
- Click on "Enable"
- Click on "Create Credentials"
- Choose "API key"
- Copy the generated token and save it somewhere
- Clone this repository
- Use docker to build the image
docker build -t asotaw-bot .
- Run the image
docker run -d -e "DISCORD_TOKEN={Refer to step 1}" -e "YOUTUBE_TOKEN={Refer to step 3}" --name {container_name} asotaw-bot
- Enjoy