1.0.1 • Published 3 years ago

discord.js-economy v1.0.1

Weekly downloads
75
License
ISC
Repository
-
Last release
3 years ago

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!')
}

1.0.1

3 years ago

1.0.0

3 years ago

0.0.0

4 years ago