Giter Club home page Giter Club logo

discordify's Introduction

Screenshot

discordify

A single-server focused music bot for Discord.

Installation

Following is a short tutorial on how to spin up your own instance of the bot. however, in order to run, the bot requires some credentials - more specifically a Discord bot token as well as the id of the bot user and a YouTube api key.

  1. A Discord bot token is optained by creating a new app on the Discord app dashboard and then registering the app as a Bot User. Remember to also subscribe the bot to the various Privilidged Gateway Intents!
  2. The id of the bot user can then also be copy-pasted from the Discord app dashboard.
  3. A YouTube API v3 key can be optained for free by logging in to the Google API Dashboard and registering a new project. After this, YouTube API v3 can be found under the "Library" tab on the left hand side, where you can choose to generate a new api key.

Hold on to this information, as it will become relevant in a minute. Now, for the actual installation process. This will be detailed using the command line on an Ubuntu 16.04 machine, even though the code should be able to run in any environment that supports NodeJS. Along with NodeJS, this guide also assumes that you have Git, NPM, and node-gyp installed.

  1. Start by navigating to a suitable place for the bot source files to be installed.
  2. Next download the bot source files with git clone https://github.com/kuff/discordify.git and enter the directory by typing in cd discordify.
  3. Now, install FFMPEG with sudo apt-get install ffmpeg. This is needed for encoding audio for Discord voice chat.
  4. Next up, install the bot dependencies with npm i.
  5. Now those credentials from earlier come into play. Start by creating a config.json file with touch config.json and open it in your favorite text editor.
  6. Then copy-paste the information gathered earlier, structured the following way:
{
    "token": "discord_bot_token_goes_here",
    "self_id": "discord_bot_id_goes_here",
    "youtube_api_key": "youtube_api_key_goes_here"
}
  1. After typing in your information and saving the file you should be all set. The bot also ships with built in automated tests that can be run with npm test - if they pass you should be all set, or though some tests are based on timings and might require a few tries! The tests are also fairly bandwidth intensive and if they fail due to a timeout it should be an indication that your bandwidth is less than ideal for streaming music through the Discord API.
  2. Now, invite the bot to you Discord server by visiting the following link, substituting "BOT_ID_GOES_HERE" with your own bot id: https://discordapp.com/oauth2/authorize?&client_id=BOT_ID_GOES_HERE&scope=bot&permissions=8.
  3. Finally, spin up the bot with npm start. However, for long term program execution you should look into PM2 or a similar tool.

Setup

Under the main directory there's a settings.json file where you can tweak a few things to your liking:

{
    "prefix": ".",
    "embed_color": 923430,
    "memory_size": 5,
    "default_volume": 0.07,
    "audio_passes": 1,
    "always_autoplay": false
}
  1. The prefix is the special character(s) that the bot should react on, meaning the one you put in front of a command keyword when you want the bot to do something, e.g. .play a songor .pause. As a result, I recommend that this be a special character, ensuring the bot is not invoked by mistake!
  2. The embed_color is the color code for the embeds, more specifically the vertical strip of solid color on the left hand side of the Discord embeds. I recommend keeping this a darker color and have it match the pofile picture of your bot user. Select from some of these presets or use this handy tool to experiment with different embed colors!
  3. The memory_size parameter is how many previously played songs the bot should remember. This is invoked with the .replay command and when autoplaying, and I do not recommend keeping it shorter than five.
  4. default_volume is the volume used for playback when the bot starts playing. During playback the volume can then be changed with .volume, but is then reset once playback ends.
  5. audio_passes dictates how many passes of the data is sent through the the Discord API. This is useful to help mitigate packet loss but will also significantly increase bandwidth usage, and as a result should probably not be changed!
  6. always_autoplay, if enabled, the bot will always autoplay if the queue is empty. By default (false), playback will terminate when the end of the queue is reached.

See the help command for a list of all available commands, and let me know if you have any trouble or suggestions through the issue tracker!

discordify's People

Contributors

dependabot[bot] avatar kuff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rebazluqman

discordify's Issues

error code help me pls

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

sometimes bug

image
sometimes when run command play bot bugs like this and after this answering that im not in same voice with bot, but bot not in the voice

nothing is working

yesterday dispatcher stop working idk why
Screenshot_6
internal/validators.js:117 throw new ERR_INVALID_ARG_TYPE(name, 'string', value); TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received undefined at validateString (internal/validators.js:117:11) at Url.parse (url.js:159:3) at Object.urlParse [as parse] (url.js:154:13) at doDownload (/home/container/node_modules/miniget/dist/index.js:90:28) at processTicksAndRejections (internal/process/task_queues.js:79:11) { code: 'ERR_INVALID_ARG_TYPE' /entrypoint.sh: line 12: ./usr/local/bin/node: No such file or directory

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.