adv-rep-system v1.0.10
advanced-rep-system
Advanced package which will help you to create your own reputation system
Instalation
npm i adv-rep-system
Example
const { Client, Intents } = require('discord.js')
const AdvDiscordRep = require('adv-rep-system')
const repsystem = new AdvDiscordRep()
const client = new Client({
intents: Object.values(Intents.FLAGS) // Best way to have all the intents ( if you can not explain what intents do you need )
})
client.on('ready', () => {
console.log("I'm online!")
repsystem.connect("") // here you paste your mongoDB connection string, or variable, that store this URL
})
client.on('interactionCreate', async(interaction) => {
if(interaction.commandName === 'positiverep') {
const user = interaction.options.getUser('user') // Note: This is example, but you will need to use .getUser() method to fetch user and add data to db
repsystem.addPositiveRep(user.id, interaction.guild.id)
}
if(interaction.commandName === 'negativerep') {
const user = interaction.options.getUser('user') // Note: Same as above
repsystem.addNegativeRep(user.id, interaction.guild.id)
}
if(interaction.commandName === 'replist') {
const user = interaction.options.getUser('user')
repsystem.replist(user.id)
}
})
Method #1
.addPositiveRep()
- add positive reputation to an user
Input:
.addPositiveRep(<userID: String>, <guildID: String>)
Output:
Promise<Object>
Method #2
.addNegativeRep()
- add negative reputation to an user
Input:
.addNegativeRep(<userID: String>, <guildID: String>)
Output:
Promise<Object>
Method #3
.replist()
- display user reputation list ( currently deprecated, working on it.. )
License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.