discord-wallet
v1.0.4
Published
Integration for the Wallet Discord bot.
Downloads
4
Readme
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.