
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
discord-eco
Advanced tools
Note: This package is under development and will be updated frequently.
This package is meant to provide an easy way to access core economy features.
Installation
npm install discord-eco
Require Package
var economy = require('discord-eco');
Fetch Balance
No need to create a database, it does that automatically.
economy.fetchBalance('userID').then((i) => {
console.log(i) // { userID: '144645791145918464', money: 998, lastDaily: 'Not Collected' }
console.log(i.money) // 998
});
Update Balance
Value must be an integer. If you want to subtract from the balance make it a negitave number.
economy.updateBalance('userID', 'value').then((i) => {
console.log(i) // Returns the updated result.
console.log(i) // Returns the updated result.
});
Example Bot | View Output
// Call Packages
const Discord = require('discord.js');
const economy = require('discord-eco');
// Define client for Discord
const client = new Discord.Client();
// This runs when a message is recieved...
client.on('message', message => {
// Prefix
let prefix = '!';
// There are multiple ways you can use discord-eco.
// Example: Fetching Balance
if (message.content.toUpperCase() === `${prefix}BALANCE`) {
economy.fetchBalance(message.author.id).then((i) => { // economy.fetchBalance grabs the userID, finds it, and puts it into 'i'.
message.channel.send(`**Balance:** ${i.money}`);
})
}
// Example: Adding Money To A User
if (message.content.toUpperCase() === `${prefix}PAYDAY`) {
economy.updateBalance(message.author.id, 500).then((i) => { // economy.updateBalance grabs the (userID, value) value being how much you want to add, and puts it into 'i'.
message.channel.send(`**You got $500!**\n**New Balance:** ${i.money}`);
})
}
// Example: Removing Money From A User
if (message.content.toUpperCase() === `${prefix}PAYFINE`) {
economy.updateBalance(message.author.id, -500).then((i) => { // Since the 'value' is -500, it will 'add' -500, making the balance $500 lower.
message.channel.send(`**You paid your fine of $500!**\n**New Balance:** ${i.money}`);
})
}
});
client.login('token')
FAQs
Framework of a discord bot being used in a tutorial series.
The npm package discord-eco receives a total of 19 weekly downloads. As such, discord-eco popularity was classified as not popular.
We found that discord-eco demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.