A Discord bot which plays sound effects as a virtual soundboard through commands.
I wanted to play sound effects through Discord calls and could not find a bot for my liking. Here's my bot which allows custom sound effects to be played through YouTube.
List of sample sound effects.
Clone the repository at GitHub and follow the Getting Started instructions.
Command | Description |
---|---|
kick |
Kicks the bot |
soundboard |
Displays information for all the bot commands (including custom sounds) |
Create a new Discord bot at the Discord Developer Portal and copy the token. More information about generating a new bot can be found here. You will need to create a file to store the token named config.json
and copy the following:
{
"prefix": "!",
"token": "<token>",
"role": "<role>"
}
Replace <token>
with the token and save the file in the ~/Soundboard
folder. You can also set the role which allows users to remove the bot from the channel.
Now that you have the files on your machine and the bot ready to go, you will need Node.js to run the bot. Open a bash terminal and navigate to the file location; ~/Soundboard
.
You will need to install some node modules that Soundboard relies on to function:
npm i discord.js
npm i ytdl-core
npm i fs
Your bot should be ready to go now. Run the bot with the command:
node index.js
Make sure that you are an admin of the server, you will need this to run the configuration commands.
Soundboard commands can be found with the following command:
!soundboard
Hop into a voice channel and enter a sound command; e.g. a laugh track:
!laugh
The bot can be removed at anytime while a sound effect is playing with:
!kick
You can add custom sounds to the bot by adding a JSON file. Navigate to the ~/Soundboard/sounds
folder and create a new JSON file and copy the following:
{
"name": "<name>",
"url": "<youtube url>",
"description": "<description>"
}
The name will be the command to enter to trigger the sound effect. The URL should be a link to a YouTube video. The description is a explanation of what sound the command plays.
- Bot Icon: Paul Pilarte - Unsplash
- Base Code: Gabriel Tanner - GitHub