Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit 8e0c871

Browse files
Initial Commit
0 parents  commit 8e0c871

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3782
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
package-lock.json
3+
test/token.js
4+
src/logs/*
5+
test/BaseTest/logs/*
6+
test/BaseTest/logs
7+
test/FullTest/logs/*
8+
test/FullTest/logs

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
package-lock.json
3+
test/token.js
4+
src/logs/*
5+
test/BaseTest/logs/*
6+
test/BaseTest/logs
7+
test/FullTest/logs/*
8+
test/FullTest/logs

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers 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, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Harrison Howard (Forbidden-Duck)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Read [Github](https://github.com/Forbidden-Duck/eris.js-commando) README, in case of unpublished changes
2+
# Eris.js-Commando
3+
A custom [Eris](https://github.com/abalabahaha/eris) command handler designed for [Forbidden Statistics](https://github.com/Forbidden-Duck/ForbiddenStatistics)
4+
5+
```
6+
npm install eris.js-commando
7+
```
8+
9+
Install [forbidden-node-logger](https://github.com/Forbidden-Duck/forbidden-node-logger) for a colour node console logger
10+
```
11+
npm install forbidden-node-logger
12+
```
13+
[![NPM Version](https://badgen.net/npm/v/eris.js-commando)](https://www.npmjs.com/package/eris.js-commando)
14+
[![NPM Downloads](https://badgen.net/npm/dm/eris.js-commando)](https://www.npmjs.com/package/eris.js-commando)
15+
16+
## Getting Started
17+
18+
### [Documentation](https://github.com/Forbidden-Duck/eris.js-commando/tree/master/docs/)
19+
20+
### Basic Bot
21+
```js
22+
const Commando = require("eris.js-commando");
23+
const bot = Commando.CommandClient(token, {}, {
24+
name: "CoolErisBot",
25+
description: "My super cool bot that can do everything!",
26+
prefix: "!"
27+
}, { dirPath: __dirname + "/logs" });
28+
// replace { dirPath: __dirname + "/logs" } with false if you don't have "forbidden-node-logger"
29+
// Along with that remove all bot.Logger references
30+
31+
bot.Logger.on("error", () => {});
32+
bot.on("ready", () => {
33+
bot.Logger.log("none", `Client ready! Logged in as &-6${bot.user.username}&r (&-c${bot.user.id}&r)`);
34+
});
35+
36+
bot.registerGroup("Basic", "basic");
37+
bot.registerCommandsIn(__dirname + "/commands");
38+
39+
bot.connect();
40+
```
41+
42+
## Test Scripts
43+
In the project directory you can run the following scripts (Make sure you have the environment setup correctly):
44+
45+
### `npm run base`
46+
Will run the Base Test of the handler\
47+
Located at *test/BaseTest/bot.js*
48+
49+
### `npm run full`
50+
Will run the Full Test of the handler\
51+
Located at *test/FullTest/bot.js*

docs/Classes/Command.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Command
2+
Represents a Command
3+
4+
## Properties
5+
.client
6+
> Client that is attached to the command\
7+
> type [CommandClient](https://github.com/Forbidden-Duck/eris.js-commando/tree/master/docs/Classes/CommandoClient.md)
8+
9+
.name
10+
> Name of the command\
11+
> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
12+
13+
.group
14+
> Group the command belongs to\
15+
> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) | [Group](https://github.com/Forbidden-Duck/eris.js-commando/tree/master/docs/Classes/Group.md)
16+
17+
.optionsUsed
18+
> Options used on the command\
19+
> type [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
20+
21+
.description
22+
> Description of the command\
23+
> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
24+
25+
.usage
26+
> Usage of the command\
27+
> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
28+
29+
.aliases
30+
> An array of command aliases\
31+
> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]
32+
33+
.guildOnly
34+
> If the command is guild only\
35+
> type [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
36+
37+
.ignoreBots
38+
> If the command should ignore bots\
39+
> type [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
40+
41+
.queues
42+
> An object mapping all queues\
43+
> preCommand? [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)\
44+
> postCommand? [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)\
45+
> type [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
46+
47+
.requires
48+
> An object mapping all command requirements\
49+
> userIDs? [User](https://abal.moe/Eris/docs/User)[]\
50+
> roleIDs? [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]\
51+
> permissions? [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]\
52+
> type [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
53+
54+
.invalidRequireMSG
55+
> Message to send when a requirements fails\
56+
> type [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
57+
58+
## Constructor
59+
`new Commando.Command(client, name, group, options, execute)`
60+
> Parameter | Default | Description | Type
61+
> --------- | ------- | ----------- | ----
62+
> client | | Client that is attached to the command | [CommandClient](https://github.com/Forbidden-Duck/eris.js-commando/tree/master/docs/Classes/CommandoClient.md)
63+
> name | | Name of the command | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
64+
> group | | Group the command belongs to | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
65+
> options? | {} | All optional, Object mapping command options | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
66+
> options.description? | "No description" | Description of the command | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
67+
> options.usage? | "No usage" | Usage of the command | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
68+
> options.aliases? | [] | An array of command aliases | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]
69+
> options.guildOnly? | false | If the command is guild only | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
70+
> options.ignoreBots? | true | If the command should ignore bots | [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
71+
> options.queues? | {} | An object mapping command queues | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
72+
> options.queues.preCommand? | | Executed before the command | [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
73+
> options.queues.postCommand? | | Executed after the command | [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
74+
> options.requires? | {} | Object mapping all command requirements | [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
75+
> options.requires.users? | [] | An array of Users | [User](https://abal.moe/Eris/docs/User)[]
76+
> options.requires.roleIDs? | [] | An array of Role IDs | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]
77+
> options.requires.permissions? [] | An array of permissions | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]
78+
> options.invalidRequireMSG? | | Message to send if the requirements check fails | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
79+
> execute? | undefined | Function to be executed | [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)> \| [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
80+
81+
## Functions
82+
execute(message, args)
83+
> Executes when the command is finished processing
84+
> Parameter | Description | Type
85+
> --------- | ----------- | ----
86+
> message | Message the command originated from | [Message](https://abal.moe/Eris/docs/Message)
87+
> args | An array of arguments | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)[]

0 commit comments

Comments
 (0)