discord-wallet

1.0.4 • Public • Published

Welcome to Wallet!

Wallet is a project designed to connect Discord's economy bots. With a simple installation and set-up, any dev can add their bot to the Wallet economy!

Questions? Comments? Concerns? Join the Discord server!
https://discord.gg/aKGv9z2g8B


Getting Started

const Wallet = require('discord-wallet');


Wallet.addToWallet(client, userID, amountOfCurrency, currencySymbol /* Optional, defaults to $ */);

Wallet.removeFromWallet(client, userID, amountOfCurrency, currencySymbol);

Wallet.checkBalance(client, userID, currencySymbol);

// Including a currency symbol will affect how your currency is viewed in the Wallet bot.

Example

const Discord = require('discord.js');
const Wallet = require('discord-wallet');

const client = new Discord.Client();

client.on('message', async message => {
    const command = message.content.split(' ');
    const args = message.content.split(' ').shift();

    if(command == '!wallet') {
        if(args[0] == 'add') {
            let deposit = await Wallet.addToWallet(client, message.author.id, args[1]);

            console.log(deposit);
            // In case of error.

            yourDatabase.money -= args[1];
            // Remove the amount from your database.

            message.channel.send(`Desposited ${args[0]} in your Wallet.`);
        }

        if(args[0] == 'balance') {
            let balance = await Wallet.checkBalance(client, message.author.id);

            message.channel.send(`You have $${balance} in your Wallet.`);
        }
    }
})

Warning: Abuse of any of Wallet's features will have your bot banned. Think you've found an exploit? Let us know in the Discord server.

Package Sidebar

Install

npm i discord-wallet

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

3.59 kB

Total Files

3

Last publish

Collaborators

  • panicakr