teamy
A powerful library to manage teams with your own database
Made by HarmoGlace
Table of Contents
Installation
With npm
$ npm install teamy
With yarn
$ yarn add teamy
Recommended node version: 14.12.0 (Current)
Required node version: 14.4.0
Example usage
For a basic teams system using enmap as database provider:
const TeamsManager = ;const Enmap = ;const points = name: 'points'; const manager = teams: id: 'cool_team' name: 'A pretty cool team' id: 'another_cool_team' name: 'Another cool team' functions: // Can be async functions or can return a promise points points ; const coolTeam = manager; coolTeampoints; coolTeampoints; // returns 500 manager // returns an array of all teams manager // returns 'a pretty cool team' Team
For an advanced system with parent teams and sub teams and team detection with a role (using discord.js) :
const TeamsManager = ;const Client = ;const client = ;const Enmap = ;const pointsDB = name: 'points'; const manager = type: 'advanced' teams: id: 'parent1' role: '123456789' // Optional subs: id: 'sub1' role: '123456789' // optional, used to detect member role if a client and a guildId are given id: 'parent2' subs: id: 'sub2' role: '23456789' functions: // Needed. Used to save points, you can use the database that you want, here it is enmap pointsDB pointsDB client guild: '123456789' // guild Id where these teams belong to. It will be used to get roles; const sub1 = manager; sub1points; sub1points // return 153 sub1parent // returns parent Team client
API Reference
The api reference is available at teamy.harmoglace.fr
How to have a team property on GuildMembers with implement TeamsManager option [optional]
Type: Boolean
Options passed to the TeamsManager, if set to true, it will enable team and teams properties on each GuildMember.
For that you need to instantiate your client after creating the TeamsManager
Example (using a basic manager and with enmap as DB provider):
const TeamsManager = ;const Enmap = ;const points = name: 'points'; const manager = teams: id: 'cool_team' name: 'A pretty cool team' id: 'another_cool_team' name: 'Another cool team' functions: points points teams; const Client = ;const client = ; managerclient = client; client
How to contribute
Please note that teamy is still in development.
If you are here it means that you want to help me, thank you !
To contribute, create a fork of your this project, edit the things that you want and create a Pull Request.
Feedback
Report an issue
If you want to report an issue, open an issue here using the bug report template
Please check that you have the required node version at least and that you have the latest version of teamy
Suggest something
If you want to suggest something you are welcome !
Open an issue here using the suggestion template.
Support
Do you need help ? Join the Teamy Discord server