Added basic documentation

This commit is contained in:
Vylpes 2020-10-20 10:59:53 +01:00
parent 19c4e1df3f
commit 990d1ff492
3 changed files with 593 additions and 2 deletions

129
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,129 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

419
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,419 @@
# Contributing to VylBot Core
First off, thanks for taking the time to contribute!
The following is a set of guidelines for contributing to VylBot Core. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request.
## Code of Conduct
This project and everyone participating in it is governed by the VylBot Core Code of Conduct. By participating, you are expected to uphold this code.
## Questions about VylBot Core
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
You can ask a question about the project in the `#development` channel in the [Discord Server](https://discord.gg/UyAhAVp).
## What you should know
### Javascript and Node
VylBot Core uses [NodeJS](https://nodejs.org/), and therefore Javascript, as its runtime. You should know how to use this.
### DiscordJS
VylBot Core uses [DiscordJS](https://discord.js.org/) as its framework. Although you could contribute without much knowledge of this if you know NodeJS well, however it is recommended to know this.
## Conventions
There are a few conventions that have developed over time for this project. When you create a pull request a check will be ran making sure that your code follows these conventions.
We won't accept pull requests unless these checks pass. If yours fail, simply fix what the bot says until it passes and then get a repo member to review your code.
The rules for the code is based upon [Vylpes' Config Repo](https://github.com/vylpes/config)
* Variable names should use **Camel Case**
* Functions should put **braces on the same line**
* **No comma dangle**, i.e. having a commma after the last item in an object
* **Arrow body style** should have braces around the body only when needed
* **Arrow parameters** should have brackets around them only when needed
* **Arrow spacing** should have a space around the arrow (' => ')
* **No var** should be used, instead use either let or const when appropriate
## How You Can Contribute
### Reporting Bugs
This section guides you through submitting a bug report for VylBot Core. Following these guidelines helps maintainers and the community understand your report. reproduce the behaviour, and find related reports.
When you are creating a bug report, please include as many details as possible.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
#### Before Submitting A Bug Report
* **Perform a search** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
#### How You Can Submit A (Good) Bug Report
Bugs are tracked as GitHub issues. After you've determined the bug you're reporting hasn't got a pre-existing **open** issue already, create an issue and provide information from below.
* **Use a clear and descriptive title** for the issue to indentify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started VylBot Core (if you're using your own instance), which command exactly you used, and the output which the bot replied with. If its your own instance, provide information on what the terminal output said, if any.
* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pastable snippets, which you use in those examples. If you're providing snippets in the issue, use Markdown code blocks.
* **Describe the behaviour you observed after following the steps** and point out what exactly is the problem with that behaviour.
* **Explain which behaviour you expected to see instead and why.**
* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem.
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
Provide more context by answering these questions:
* **Did the problem start happening recently** (e.g. after updating to a new version of VylBot Core) or was this always a problem?
* If the problem started happening recently, **can you reproduce the problem in an older version of VylBot Core?** What's the most recently version in which the problem doesn't happen? You can download older versions of VylBot Core from the releases page.
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
Include details about your configuration and environment:
* **Which version of VylBot Core are you using?** You can get the exact version by running the `about` command.
* **Do you have any custom commands added to the commands folder?** If you do, provide information on what the command does, and a link to the command file if it exists.
> **Note:** We do not provide any support on issues caused by custom commands. You are welcome to create an issue if you believe the issue is to do with the base code, but if the error is to do with that custom command we are unable to fix that, you will need to contact the author of that command.
* **What's the name and version of the OS you're using?**
* **Are you running VylBot Core in a virtual machine?** If so, which VM software are you using and which operating systems and versions are used for the host and the guest?
* **What version of node do you have installed?** You can get this version by running the `node -v` command in your terminal.
* **What does your `config.json` file look like?**
> **Note:** remember to **not** give out your bot tokens which are inside of the `config.json` file. If you're giving a copy of your configuration remember to delete the tokens from the string and leave the empty.
* **Are you running the bot in live or dev mode?**
### Suggesting Enhancements
This section guides you through submitting an enhancement suggestion for VylBot Core, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
When you are creating an enhancement suggestion, please include as many details as possible. Fill out the suggestion with the steps that you imagine you would take if the feature you're requesting existed.
#### Before Submitting an Enhancement Suggestion
* **Check if the feature already exists.** Make sure to check on the latest version and if you can get the desired behaviour using the config options inside of `config.json`
* **Perform a search** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
#### How Do I Submit A (Good) Enhancement Suggestion?
Enhancement suggestions are tracked as GitHub issues. After you've determined the feature doesn't already exist or been suggested before, create an issue on that repository and provide the following information:
* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide specific examples to demonstrate the steps.** Include copy/pastable snippets which you use in those examples, as Markdown code blocks.
* **Describe the current behaviour** and **explain which behaviour you expected to see instead** and why.
* **Include screnshots and animated GIFs** which help you demonstrate the steps or point out the part of VylBot Core which the suggestion is related to.
* **Explain why this enhancement would be useful** to most VylBot Core users and isn't something that can or should be implemented as a custom command.
* **List some other bots where this enhancement exists.**
* **Specify which version of VylBot Core you're using.** You can get the exact version by running the `about` command.
* **Specify the name and version of the OS you're using.**
### Your First Code Contribution
Unsure where to begin contributing to VylBot Core? You can start by looking through these `good first` and `help wanted` issues:
* [Good first issue](https://github.com/GetGravitySoft/VylBot Core/labels/good%20first%20issue) - issues which should only require a few lines of code, and a test or two.
* [Help wanted](https://github.com/GetGravitySoft/VylBot Core/labels/help%20wanted) - issues which should be a bit more involved than `good first` issues.
#### Prerequisites
In order to download necessary tools, clone the repository, and install dependencies via `npm` you need network access.
You'll need the following tools:
* Git
* NodeJS
Install and build all of the dependencies using `npm`
```bash
cd VylBot Core
npm install
cp config.json.template config.json
```
And then use your text editor of choice to fill in the `config.json` file.
#### Build and Run
If you want to understand how VylBot Core works or want to debug an issue, you'll want to get the source, build it, and run the tool locally.
First, fork the VylBot Core repository so that you can make a pull request. Then, clone your fork locally:
```bash
git clone https://github.com/<your-github-account>/VylBot Core.git
```
Occasionally, you will want to merge changes in the upstream repository (the official code repo) with your fork.
```bash
cd VylBot Core
git checkout master
git pull https://github.com/getgravitysoft/VylBot Core.git master
```
Manage any merge conflicts, commit them, and then push them to your fork.
Go into `VylBot Core` and start the bot in dev mode with `npm run dev` or `node bot dev`
> **Note:** If you have `nodemon` installed on your system you can use this during development so it auto restarts when you make code changes. Instead of the commands above you can then run `nodemon bot dev`.
#### Pull Requests
The process described here has several goals:
* Maintain VylBot Core's quality
* Fix problems that are important to users
* Engage the community in working toward the best possible VylBot Core
* Enable a sustainable system for VylBot Core's maintainers to review contributions
Please follow these steps to have your contribution considered by maintainers:
* You mention the issue id which this pull request aims to fix
* After you submit your pull request, verify that all status checks are passing.
> **Note**: If a check fails the pull request it is important that you go and fix these issues, or let us know that you no longer want to work on this issue by commenting on the pull request. Doing this will give you a better chance of having your pull request merged.
* When the checks have passed a maintainer will review your code and ask for any improvements or questions, and will merge it if they are satisifed.
While the prerequesites above must be satisifed prior to having your pull reuqest accepted, the reviewer(s) may ask you to complete additional design ork, tests, or other changes before your pull request can be ultimately accepted.
#### JavaScript Styleguide
All JavaScript code is linted with `eslint`.
* Prefer camelcase for variable names
* Prefer braces `{` to be on the same line
* Prefer no comma `,` dangle
* Prefer arrow function bodies to have brances `{}` only when needed
* Prefer arrow function parameters to have brackets `()` only when needed
* Prefer arrow function arrows `=>` to have a space before and after it
* Prefer `let` and `const` over `var`
As well as eslint's recommended defaults.
Example
```js
function ban (member) {
let reason = "Example reason";
member.ban(reason).then(() => {
// handle then here
}).catch(err => {
// handle error here
});
}# Contributing to VylBot Core
First off, thanks for taking the time to contribute!
The following is a set of guidelines for contributing to VylBot Core. These are mostly guidelines, not rules. Use your best judgement, and feel free to propose changes to this document in a pull request.
## Code of Conduct
This project and everyone participating in it is governed by the VylBot Core Code of Conduct. By participating, you are expected to uphold this code.
## Questions about VylBot Core
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
You can ask a question about the project in the `#development` channel in the [Discord Server](https://discord.gg/UyAhAVp).
## What you should know
### Javascript and Node
VylBot Core uses [NodeJS](https://nodejs.org/), and therefore Javascript, as its runtime. You should know how to use this.
### DiscordJS
VylBot Core uses [DiscordJS](https://discord.js.org/) as its framework. Although you could contribute without much knowledge of this if you know NodeJS well, however it is recommended to know this.
## Conventions
There are a few conventions that have developed over time for this project. When you create a pull request a check will be ran making sure that your code follows these conventions.
We won't accept pull requests unless these checks pass. If yours fail, simply fix what the bot says until it passes and then get a repo member to review your code.
The rules for the code is based upon [Vylpes' Config Repo](https://github.com/vylpes/config)
* Variable names should use **Camel Case**
* Functions should put **braces on the same line**
* **No comma dangle**, i.e. having a commma after the last item in an object
* **Arrow body style** should have braces around the body only when needed
* **Arrow parameters** should have brackets around them only when needed
* **Arrow spacing** should have a space around the arrow (' => ')
* **No var** should be used, instead use either let or const when appropriate
## How You Can Contribute
### Reporting Bugs
This section guides you through submitting a bug report for VylBot Core. Following these guidelines helps maintainers and the community understand your report. reproduce the behaviour, and find related reports.
When you are creating a bug report, please include as many details as possible.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
#### Before Submitting A Bug Report
* **Perform a search** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
#### How You Can Submit A (Good) Bug Report
Bugs are tracked as GitHub issues. After you've determined the bug you're reporting hasn't got a pre-existing **open** issue already, create an issue and provide information from below.
* **Use a clear and descriptive title** for the issue to indentify the problem.
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started VylBot Core (if you're using your own instance), which command exactly you used, and the output which the bot replied with. If its your own instance, provide information on what the terminal output said, if any.
* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pastable snippets, which you use in those examples. If you're providing snippets in the issue, use Markdown code blocks.
* **Describe the behaviour you observed after following the steps** and point out what exactly is the problem with that behaviour.
* **Explain which behaviour you expected to see instead and why.**
* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem.
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
Provide more context by answering these questions:
* **Did the problem start happening recently** (e.g. after updating to a new version of VylBot Core) or was this always a problem?
* If the problem started happening recently, **can you reproduce the problem in an older version of VylBot Core?** What's the most recently version in which the problem doesn't happen? You can download older versions of VylBot Core from the releases page.
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
Include details about your configuration and environment:
* **Which version of VylBot Core are you using?** You can get the exact version by running the `about` command.
* **Do you have any custom commands added to the commands folder?** If you do, provide information on what the command does, and a link to the command file if it exists.
> **Note:** We do not provide any support on issues caused by custom commands. You are welcome to create an issue if you believe the issue is to do with the base code, but if the error is to do with that custom command we are unable to fix that, you will need to contact the author of that command.
* **What's the name and version of the OS you're using?**
* **Are you running VylBot Core in a virtual machine?** If so, which VM software are you using and which operating systems and versions are used for the host and the guest?
* **What version of node do you have installed?** You can get this version by running the `node -v` command in your terminal.
* **What does your `config.json` file look like?**
> **Note:** remember to **not** give out your bot tokens which are inside of the `config.json` file. If you're giving a copy of your configuration remember to delete the tokens from the string and leave the empty.
* **Are you running the bot in live or dev mode?**
### Suggesting Enhancements
This section guides you through submitting an enhancement suggestion for VylBot Core, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
When you are creating an enhancement suggestion, please include as many details as possible. Fill out the suggestion with the steps that you imagine you would take if the feature you're requesting existed.
#### Before Submitting an Enhancement Suggestion
* **Check if the feature already exists.** Make sure to check on the latest version and if you can get the desired behaviour using the config options inside of `config.json`
* **Perform a search** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
#### How Do I Submit A (Good) Enhancement Suggestion?
Enhancement suggestions are tracked as GitHub issues. After you've determined the feature doesn't already exist or been suggested before, create an issue on that repository and provide the following information:
* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide specific examples to demonstrate the steps.** Include copy/pastable snippets which you use in those examples, as Markdown code blocks.
* **Describe the current behaviour** and **explain which behaviour you expected to see instead** and why.
* **Include screnshots and animated GIFs** which help you demonstrate the steps or point out the part of VylBot Core which the suggestion is related to.
* **Explain why this enhancement would be useful** to most VylBot Core users and isn't something that can or should be implemented as a custom command.
* **List some other bots where this enhancement exists.**
* **Specify which version of VylBot Core you're using.** You can get the exact version by running the `about` command.
* **Specify the name and version of the OS you're using.**
### Your First Code Contribution
Unsure where to begin contributing to VylBot Core? You can start by looking through these `good first` and `help wanted` issues:
* [Good first issue](https://github.com/GetGravitySoft/VylBot Core/labels/good%20first%20issue) - issues which should only require a few lines of code, and a test or two.
* [Help wanted](https://github.com/GetGravitySoft/VylBot Core/labels/help%20wanted) - issues which should be a bit more involved than `good first` issues.
#### Prerequisites
In order to download necessary tools, clone the repository, and install dependencies via `npm` you need network access.
You'll need the following tools:
* Git
* NodeJS
Install and build all of the dependencies using `npm`
```bash
cd VylBot Core
npm install
cp config.json.template config.json
```
And then use your text editor of choice to fill in the `config.json` file.
#### Build and Run
If you want to understand how VylBot Core works or want to debug an issue, you'll want to get the source, build it, and run the tool locally.
First, fork the VylBot Core repository so that you can make a pull request. Then, clone your fork locally:
```bash
git clone https://github.com/<your-github-account>/VylBot Core.git
```
Occasionally, you will want to merge changes in the upstream repository (the official code repo) with your fork.
```bash
cd VylBot Core
git checkout master
git pull https://github.com/getgravitysoft/VylBot Core.git master
```
Manage any merge conflicts, commit them, and then push them to your fork.
Go into `VylBot Core` and start the bot in dev mode with `npm run dev` or `node bot dev`
> **Note:** If you have `nodemon` installed on your system you can use this during development so it auto restarts when you make code changes. Instead of the commands above you can then run `nodemon bot dev`.
#### Pull Requests
The process described here has several goals:
* Maintain VylBot Core's quality
* Fix problems that are important to users
* Engage the community in working toward the best possible VylBot Core
* Enable a sustainable system for VylBot Core's maintainers to review contributions
Please follow these steps to have your contribution considered by maintainers:
* You mention the issue id which this pull request aims to fix
* After you submit your pull request, verify that all status checks are passing.
> **Note**: If a check fails the pull request it is important that you go and fix these issues, or let us know that you no longer want to work on this issue by commenting on the pull request. Doing this will give you a better chance of having your pull request merged.
* When the checks have passed a maintainer will review your code and ask for any improvements or questions, and will merge it if they are satisifed.
While the prerequesites above must be satisifed prior to having your pull reuqest accepted, the reviewer(s) may ask you to complete additional design ork, tests, or other changes before your pull request can be ultimately accepted.
#### JavaScript Styleguide
All JavaScript code is linted with `eslint`.
* Prefer camelcase for variable names
* Prefer braces `{` to be on the same line
* Prefer no comma `,` dangle
* Prefer arrow function bodies to have brances `{}` only when needed
* Prefer arrow function parameters to have brackets `()` only when needed
* Prefer arrow function arrows `=>` to have a space before and after it
* Prefer `let` and `const` over `var`
As well as eslint's recommended defaults.
Example
```js
function ban (member) {
let reason = "Example reason";
member.ban(reason).then(() => {
// handle then here
}).catch(err => {
// handle error here
});
}

View file

@ -1,2 +1,45 @@
# vylbot-core
A discord client based upon discord.js
# VylBot Core
Discord bot client based upon Discord.js
## Installation
Download the latest version from the [releases page](https://github.com/Vylpes/vylbot-core/releases).
Copy the config template file and fill in the strings.
```json
{
"token": "",
"prefix": "",
"commands": "",
"events": ""
}
```
* **Token:** Your bot's token
* **Prefix** The command prefix
* **Commands:** The folder name containing your commands
* **Events:** The folder name containing your events
## Usage
Implement the client using something like:
```js
const vylbot = require('vylbot-core');
const config = require('config.json');
const client = new vylbot.client(config);
client.start();
```
See the `docs` folder for more information on how to use vylbot-core
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
We will not merge pull requests unless all checks pass and at least one of the repo members approves it.
See CONTRIBUTING.md for more details.