Coder Social home page Coder Social logo

discord-music-and-radio-bot's Introduction

discord-music-and-radio-bot

Yet another open source Discord bot using discord-player and discord.js.

Warning, this code uses the v12 of the Discord.js module. Previous versions of discord.js will not be supported.

Issues

If you have any issue feel free to make a new issue here.

Installation

Use the package manager npm to install all the packages. Using npm install, will automatically install all the package needed. Make sure your node version is not below 12.

Configuration

Start by editing the Config/botconfig.json file:

{
  "prefix":"Your Bot Prefix",
  "embed":"Hex Colour",
  "error":"Hex Colour",
  "owner":["Your ID"]
}

Please do not mess with the config.json file inside the Config folder.

After you have finished editing the botconfig.json file, edit the .env file:

token=YOUR_TOKEN_HERE

Reminder:

  • prefix, the prefix that will be set to use the bot.
  • YOUR_TOKEN_HERE, the token of the bot available on the Discord Developers section.
  • embed & error, the embed colours your bot will use in embeds. Click here to get link to a colour picker.
  • owner, your ID to access developer-only commands if need be, to get your ID please refer to this Discord article.

Commands

  • play <name>, plays a song in a voice channnel.
  • pause, pauses the current song.
  • clear-queue, deletes the upcoming songs in the queue.
  • now-playing, see the currently playing song.
  • repeat repeats a song over and over again.
  • radio, listen to your favourite radio stations live.

Utilities

Functions available with the discord-player module that you can use :

// Play a song in the voice channel and init the guild queue
client.player.play(voiceChannel, songName);

// Add a song to the queue
client.player.addToQueue(guildID, songName);
// Clear the queue
client.player.clearQueue(guildID);
// Get the queue
client.player.getQueue(guildID);
// Skip the current song
client.player.skip(guildID);


// Pause
client.player.pause(guildID);
// Resume
client.player.resume(guildID);
// Stop
client.player.stop(guildID);

// Check if music is playing in a guild
client.player.isPlaying(guildID);
// Get the currently playing song
client.player.nowPlaying(guildID);


// Current song will be repeated indefinitely
client.player.setRepeatMode(true);
// Current song will no longer be repeated indefinitely
client.player.setRepeatMode(false);

License

MIT

Acknowledgements & Thank Yous

I <3 Open Source, so I'd like to acknowledge the brilliant packages making this repository happen.

These are the open source libraries I use to make this bot:

Thank you to:

I used both of your repositories as a help guide for making this repository, hope you don't mind guys.

discord-music-and-radio-bot's People

Contributors

benjaminjforster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

discord-music-and-radio-bot's Issues

Error api youtube

hi, i have download your bot discord and i config prefix and token... but when i start bot i have error with youtube api, i create new api youtube v3, but i dont know where to return

Do youtube alternative urls work on the music player?

As you know, Discord banned youtube and google links a while ago. We can no longer listen to youtube music on discord bots.

What sites does this bot support?

For example; Does SoundCloud also support Spotify and similar sites? Thank you.

youtube api key

` if (typeof key !== 'string') throw new Error('The YouTube API key you provided was not a string.');
^

Error: The YouTube API key you provided was not a string.
`

Yet there is no YT API key in config

Bug=

it gives if (typeof key !== 'string') throw new Error('The YouTube API key you provided was not a string.'); this kind of errir

Youtube API Key

Error: The YouTube API key you provided was not a string.
problem for running node index.js

Radio

Hey, the Radio command doesn't really work for me

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.