Coder Social home page Coder Social logo

discord-music-bot's Introduction

Discord Music Bot

In this project I use:

  • discord.py: Awesome library that implements all Discord API;
  • replit: Easy to use platform with free host and nice built-in database;
  • youtube API: Help to find videos url on youtube by query;
  • yt-dlp: Get stream url from video url on youtube.
  • Uptime Robot: To keep bot alive.

How to use

Fork this project, create a free account on replit and pull your github repo to your repl.

If you open env.py file you will see two ENV_VARIABLES. You need to feel then with your data to the bot run properly.

  • BOT_TOKEN: Create you bot in Discord Developer Portal and copy your token.
  • GOOGLE_API_TOKEN: Create account on Google Dev platform and get your token.

Don't forget to add your tokens to replit secrets (Enviroment variables). Finally click RUN (or Ctrl + Enter).

The replit server keep running for an hour without requests, after that they enter in sleeping stage. So, to prevent you bot to go to sleep you can you the free service of Uptime Robot.

Create an account on Uptime Robot and add an new monitor for the url of your repl with a interval. You don't need a short interval, I use 20 min.

Features

Note: The main code is written in English, but the bot commands and answers (with funny stuff :D) are in Portuguese, thats is my native language.

  • Prefix: .ava. Choose what you want.

  • Commands:

    • add: Receives an video url or query and add it to the list/queue. If receives a query look for the first match on YouTube. You can use " e toca" at the end of query to start playing it instantly.

    Examples:

    .ava add https://www.youtube.com/watch?v=-6J3HfX4sbg //will just append to list/queue
    .ava add zé vaqueiro tenho medo //same as previous
    .ava add coração radiante e toca //will play right after fetch needed info
    
    • toca: Receives an video url or query and play it. If arg is a query, first try to find a matching song on database list/queue, otherwise look on youtube as add command.

    Examples:

    .ava toca https://www.youtube.com/watch?v=-6J3HfX4sbg
    .ava toca ta vendo aquela lua
    
    • apaga: Receives a query and delete all matching songs on list/queue.

    Examples:

    .ava apaga tenho medo //will delete 'Tenho Medo - Zé Vaqueiro (Vídeo Oficial)'
    .ava apaga //will delete all.
    
    • config: Receives the config option and value.

    Examples:

    .ava config keep_played true //current only config type
    .ava config keep_played false
    
    • lista: Print to chat all the current songs on list/queue.

    • diz: Receives text and play it on voice channel.

    • proxima(alias=prox): Skip to next song on list/queue.

    • anterior(alias=ant): Back to previous song on list/queue.

    • perai: Pause song, if playing.

    • continua: Resume song, if paused.

    • vaza: Disconnect voice from channel, if connected.

discord-music-bot's People

Contributors

gabrieldonnantuoni avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.