discord.js-economy
v1.0.1
Published
<br></br>
Downloads
6
Readme
Installation
npm i discord.js-economy
Setup
const discordEconomy = require('discord.js-economy')
const econ = new discordEconomy({
uri: "Your MongoDB connection string"
})
Adding coins to a user
// example
if(message.content.startsWith('!daily')) {
econ.add(message.author.id, 500)
message.reply('You have collected your daily reward!')
}
Removing coins from a user
// example
if(message.content.startsWith('!remove')) {
econ.remove(message.author.id, 10)
message.reply('I have removed 10 coins from your balance')
}
Checking a user's balance
// example
if(message.content.startsWith('!bal')) {
const bal = econ.bal(message.author.id)
message.reply('You have ${bal} coins!')
}