-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
159 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,71 @@ | ||
# Contributing | ||
# Contributing to DisTube | ||
|
||
**The issue tracker is only for bug reports. If you have a question or an enhancement suggestion, please post it in the [DisTube Support Server](https://discord.gg/feaDd9h) instead of opening an issue.** | ||
Thank you for your interest in contributing to DisTube! This document provides guidelines and instructions for contributing to the project. | ||
|
||
If you wish to contribute to DisTube, feel free to fork the repository and submit a pull request. | ||
## 📝 Issues | ||
|
||
## Setup | ||
- The issue tracker is for bug reports only. | ||
- For questions or feature suggestions, please use our [Discord Support Server](https://discord.gg/feaDd9h). | ||
- Before creating an issue, please check the [FAQ](https://github.com/skick1234/DisTube/wiki/Frequently-Asked-Questions) and existing issues (both open and closed). | ||
|
||
1. Fork & clone the repository, make sure you are on the correct branch | ||
2. Run `npm ci` | ||
3. Code your idea | ||
4. Run `npm run prettier` to run Prettier | ||
5. Run `npm run lint` to run ESLint | ||
6. Run `npm run build:check` to run the compiler | ||
7. [Submit a pull request](https://github.com/skick1234/DisTube/compare) (Make sure you follow the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/)) | ||
## 🛠️ Pull Requests | ||
|
||
We welcome contributions via pull requests! Please follow these guidelines: | ||
|
||
1. **Fork the repository** and create a new branch from `main` for your changes: | ||
|
||
```bash | ||
git checkout -b feature/your-feature-name | ||
``` | ||
|
||
2. **Install dependencies:** | ||
|
||
```bash | ||
npm ci | ||
``` | ||
|
||
3. **Make your changes**, ensuring they align with the project's goals and coding style. | ||
4. **Run checks:** Before submitting, ensure your code passes the following checks: | ||
```bash | ||
npm run prettier # Format code | ||
npm run lint # Check for linting errors | ||
npm run build:check # Ensure the project compiles | ||
npm run test # Run tests | ||
``` | ||
5. **Commit your changes** using the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format: | ||
```bash | ||
git commit -m "feat: add new feature" | ||
``` | ||
6. **Create a pull request:** Push your branch to your fork and open a pull request against the `main` branch of the DisTube repository. | ||
### Pull Request Guidelines | ||
- Keep pull requests focused on a single issue or feature. | ||
- Include relevant tests for your changes. | ||
- Update documentation (if applicable). | ||
- Follow the project's existing code style. | ||
- Ensure all tests pass before submitting. | ||
- Link any related issues in the pull request description. | ||
|
||
## ⚙️ Development Setup | ||
|
||
DisTube is built with TypeScript and uses the following tools: | ||
|
||
- [pnpm](https://pnpm.io/): Package manager (though npm is also supported) | ||
- [Prettier](https://prettier.io/): Code formatter | ||
- [ESLint](https://eslint.org/): Linter | ||
- [Vitest](https://vitest.dev/): Test runner | ||
- [TypeDoc](https://typedoc.org/): Documentation generator | ||
|
||
## ⚖️ License | ||
|
||
By contributing to DisTube, you agree that your contributions will be licensed under the [MIT License](LICENSE). | ||
|
||
## ❓ Support | ||
|
||
If you have any questions or need help, please join our [Discord Support Server](https://discord.gg/feaDd9h). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve (Check the FAQ and created issues first) | ||
title: "" | ||
title: "[BUG] Short description of the bug" | ||
labels: bug | ||
assignees: "" | ||
--- | ||
|
||
**Please describe your problem in as much detail as possible:** | ||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**Further information:** | ||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
|
||
- DisTube version: | ||
- discord.js version: | ||
- Node.js version: | ||
1. Go to '...' | ||
2. Play '....' | ||
3. Run command '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Environment Information:** | ||
|
||
- DisTube version: (See line 3 of [package.json](https://github.com/skick1234/DisTube/blob/main/package.json)) | ||
- discord.js version: (See line 79 of [package.json](https://github.com/skick1234/DisTube/blob/main/package.json)) | ||
- Node.js version: (`node -v`) | ||
- Operating system: | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,46 @@ | ||
> [!WARNING] | ||
> DisTube Guide is Working in Process | ||
> This DisTube Guide is a work in progress. | ||
> [!NOTE] | ||
> This guide follows [discordjs.guide notation](https://discordjs.guide/additional-info/notation.html) | ||
> This guide follows the [discordjs.guide notation](https://discordjs.guide/additional-info/notation.html). | ||
# Introduction | ||
|
||
Welcome to the guide on creating a Discord bot with DisTube! Whether you're a seasoned developer or just starting, this step-by-step tutorial will walk you through the process of setting up a Discord bot capable of handling music commands with ease. DisTube, a powerful Discord.js module, simplifies the integration of music playback functionality, making your bot not only versatile but also enjoyable for your server members. | ||
Welcome to the DisTube guide! This tutorial will guide you through creating a Discord bot with music commands using DisTube, a comprehensive Discord music bot library built for Discord.js. DisTube simplifies music commands, offers effortless playback from diverse sources, and provides integrated audio filters. | ||
|
||
Let's dive in and bring your Discord bot to life with the magic of DisTube! 🤖🎵 | ||
Let's bring your Discord bot to life with DisTube! 🤖🎵 | ||
|
||
[](https://ko-fi.com/skick) | ||
|
||
# Prerequisites | ||
|
||
To create a Discord music bot with DisTube, you should have a solid understanding of JavaScript. You can make a music bot with very little JS, programming knowledge by using DisTube. But you may get stuck on many uncomplicated issues, and struggle with solutions to incredibly easy problems. | ||
- Solid understanding of JavaScript. While you can create a basic music bot with limited JS knowledge, a strong foundation will help you troubleshoot issues. | ||
- A basic Discord bot set up with Discord.js. Refer to [discordjs.guide](https://discordjs.guide/) if you haven't already. | ||
|
||
# Preparations | ||
|
||
Before diving into this guide, you have to create a Discord bot using Discord.js. If you haven't already, visit [discordjs.guide](https://discordjs.guide/) to familiarize yourself with the process of setting up a basic Discord bot. | ||
|
||
This guide is a continuation of your [discordjs.guide](https://discordjs.guide/) development journey, focusing on seamlessly integrating DisTube for advanced music functionality. | ||
The code written follows command handling setup from [discordjs.guide](https://discordjs.guide/), so adjustments may be necessary based on your command handler's structure. | ||
If you encounter any issues, refer to your command handler's documentation or seek assistance in the Discord.js community. | ||
This guide assumes you're familiar with the command handling setup from [discordjs.guide](https://discordjs.guide/). Adjustments may be needed based on your command handler's structure. | ||
|
||
# Installation | ||
|
||
Install DisTube in your bot project folder | ||
1. Install DisTube and required dependencies in your bot project: | ||
|
||
```sh | ||
npm install distube | ||
``` | ||
```sh | ||
npm install distube @discordjs/voice @discordjs/opus | ||
``` | ||
|
||
And you need to install all the [requirements](https://github.com/skick1234/DisTube#requirement) too. | ||
2. Install FFmpeg. See the guides for: | ||
|
||
```sh | ||
npm install @discordjs/voice @discordjs/opus sodium-native | ||
``` | ||
- [Windows](http://blog.gregzaal.com/how-to-install-ffmpeg-on-windows/) | ||
- [Linux (Ubuntu, Mint,...)](https://www.tecmint.com/install-ffmpeg-in-linux/) | ||
|
||
FFmpeg installation guide: [Windows](http://blog.gregzaal.com/how-to-install-ffmpeg-on-windows/) - [Linux (Ubuntu, Mint,...)](https://www.tecmint.com/install-ffmpeg-in-linux/) | ||
\ | ||
Download FFmpeg from [this repo](https://github.com/BtbN/FFmpeg-Builds/releases) if the download links in the guide are not available. | ||
If the links above are unavailable, download FFmpeg from [this repo](https://github.com/BtbN/FFmpeg-Builds/releases). | ||
|
||
> [!WARNING] | ||
> While `ffmpeg-static` may function, it's important to note that its stability can vary across different machines, potentially leading to issues.\ | ||
> Do NOT install `ffmpeg` npm package. Uninstall it if installed with `npm uninstall ffmpeg`. | ||
> Avoid using `ffmpeg-static` due to potential stability issues across different machines. Also, do NOT install the `ffmpeg` npm package. Uninstall it if installed with `npm uninstall ffmpeg`. | ||
|
||
3. Encryption Libraries | ||
|
||
> [!NOTE] | ||
> You only need to install one of these libraries if your system does not support `aes-256-gcm` (verify by running `require('node:crypto').getCiphers().includes('aes-256-gcm')`). | ||
- [@noble/ciphers](https://www.npmjs.com/package/@noble/ciphers) | ||
- [sodium-native](https://www.npmjs.com/package/sodium-native) |