thalesmacena / fuba-discord-bot

A discord bot made with Node.js, Typescript and Discord.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🗂 Table of Contents

📑 About

Fubá is a Discord Bot made in Node.js using the Discord.js library. The bot has music commands, which access the youtube api and work with Node's redable stream object and playing with ffmpeg. In addition, it also has simple commands that work only with the discord api, such as clearing messages and making polls.

💻 Technologies

Yarn

Node.js

Typescript

ESLint

Discord

Discord.js

youtube

FFmpeg

🛠 Commands

The bot has 2 types of commands, the music commands that deal with the youtube api and the bot's voice connection and the utility commands that are commands that only manage the discord's api.

Music Commands

▶️ play

It accepts a request from the user and searches in the youtube api for a video more relevant to the title searched, creates a play queue in the guild and connects to the user's voice channel playing the audio of the video. If there is already a play queue in the guild, add the video to the queue.

⏸ pause

Checks if there is a play queue in the guild and pauses / unpauses the bot's sound

⏭ skip

Advance to the next song in the guild's play queue

🧾 queue

Shows information about the guild's play queue, such as each video, its channel, its duration and the time until it is played. If the user enters a number in the play queue, he can get details about who ordered the song and when it was added to the queue.

⏏ remove

Removes a song of the guild's play queue

🎚 volume

Changes the audio volume of the playlist, if no parameters are passed, it only tells you the current volume of the playlist

⏹ stop

Utility Commands

🗳️ pool

The user enters a question and answer options to create a pool, the bot creates a message and reacts with each one of the options so that users can vote and react.

🧹 clear

Clear a number of messages from a text channel in a guild, only people with permissions to manage messages can use this command.

🤔 help

Sends a direct message, informing the description of each command that the bot performs. If the name of a command is passed as an argument, give more detailed information on how to use the specific command, such as what are its arguments and examples of use.

✨ Installation

Open a terminal and run the following commands:

# To copy this repository
git clone https://github.com/thalesmacena/fuba-discord-bot.git

# To move to project directory
cd fuba-discord-bot

# To install the dependencies
yarn

If you are going to run locally you need to install FFmpeg, if you are going to run on a cloud service like Heroku, remember to install a dyno with FFmpeg

⚙️ Config

You need to configure some environment variables, so rename the .env.example file to .env. Then you need to change the values for discord variables. First go to the discord application page and create an application, you can define a name and image for your application, then click on BOT and create a new bot. Copy the token and place it in DISCORD_TOKEN in the file. Then click on OAuth2 select the scope bot and administrator permissions (to save time), copy the link and enter in DISCORD_INVITE, you can access this url to invite the bot to a server. Finally, define a prefix for a character and insert it in DISCORD_PREFIX.

🔥 Running

You can run the application in development mode with the command:

# To run
yarn dev

in a few seconds the bot will login and load the commands. You can check the commands instruction by text {prefix}help.

🐱 About Fubá (the cat)

Fubá is my cat, if you like cats you can check his instagram profile

About

A discord bot made with Node.js, Typescript and Discord.js

License:MIT License


Languages

Language:TypeScript 99.8%Language:Shell 0.2%