1.0.0 • Published 4 years ago

leighton-economy v1.0.0

Weekly downloads
74
License
ISC
Repository
-
Last release
4 years ago

Installation

npm i leighton-economy 

Setup

const discordEconomy = require('leighton-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!')
}