1.0.1 • Published 3 years ago
better-discord-mongo-currency v1.0.1
Original credits to Gav10, this is a fork of his package.
Join the discord server for help and suggestions https://discord.gg/BcZDyDy9SS
discord-mongo-currency
A npm package for making economy bots.
Installation
npm i better-discord-mongo-currency
Starting
Start off by connecting discord-mongo-currency to MongoDB.
const mongoCurrency = require('discord-mongo-currency');
mongoCurrency.connect('some connection string');
All Methods
createUser(userId, guildId)
Adds a user to the database.
deleteUser(userId, guildId)
Deletes a user from the database.
giveCoins(userId, guildId, amount)
Gives coins to a user. Adds the user to the database if the user is saved to the database.
bankDeduct(userId, guildId, amount)
Deducts coins from a user.
bankGive(userId, guildId, amount)
Gives coins to a user. Adds the user to the database if the user is saved to the database.
deductCoins(userId, guildId, amount)
Deducts coins from a user.
findUser(userId, guildId)
Finds the user in the database.
giveBankSpace(userId, guildId, amount)
Gives bank space to a user.
generateCashLeaderboard(guildId, amount)
Generates a cash leaderboard.
generateBankLeaderboard(guildId, amount)
Generates a bank leaderboard.