Comments (4)
@lelbr, can you send your code? (the lines you use subtract
)
from quick.db.
@lelbr, can you send your code? (the lines you use
subtract
)
`
const Discord = require('discord.js')
const db = require('quick.db')
module.exports.run = async (bot, message, args) => {
if(!message.content.startsWith('!'))return;
let user = message.author;
let author = db.fetch(`money_${message.guild.id}_${user.id}`)
let canhaorole = message.guild.roles.get("671464285569810464");
let espadarole = message.guild.roles.get("671801998458224640");
let Embed = new Discord.RichEmbed()
.setColor("#FFFFFF")
.setDescription(`Você precisa de 7000 para comprar um canhão!`);
if (args[0] == 'canhão') {
if (author < 7000) return message.channel.send(Embed)
db.fetch(`canhao_${message.guild.id}_${user.id}`);
db.set(`canhao_${message.guild.id}_${user.id}`, true)
let Embed2 = new Discord.RichEmbed()
.setColor("#FFFFFF")
.setDescription(`<:Check:618736570337591296> Comprou canhão por 7000!!`);
db.subtract(`money_${message.guild.id}_${user.id}`, 7000)
message.member.addRole(canhaorole);
message.channel.send(Embed2)
} else if(args[0] == 'proteção') {
let Embed2 = new Discord.RichEmbed()
.setColor("#FFFFFF")
.setDescription(`YARGH! Precisas de 1.000 para comprar!`);
if (author < 1000) return message.channel.send(Embed2)
db.fetch(`life_${message.guild.id}_${user.id}`)
db.add(`life_${message.guild.id}_${user.id}`, 500)
let Embed3 = new Discord.RichEmbed()
.setColor("#FFFFFF")
.setDescription(`Compraste proteção!`);
db.subtract(`money_${message.guild.id}_${user.id}`, 1000)
message.channel.send(Embed3)
} else if (args[0] == 'sabre') {
let Embed8 = new Discord.RichEmbed()
.setColor("#FFFFFF")
.setDescription(`Você precisa de 700 para comprar um sabre!`);
if (author < 700) return message.channel.send(Embed8)
db.fetch(`espada_${message.guild.id}_${user.id}`);
db.set(`espada_${message.guild.id}_${user.id}`, true)
let Embed10 = new Discord.RichEmbed()
.setColor("#FFFFFF")
.setDescription(`Compraste el espadon!!`);
db.subtract(`money_${message.guild.id}_${user.id}`, 700)
message.member.addRole(espadarole);
message.channel.send(Embed10)
} else {
let embed3 = new Discord.RichEmbed()
.setColor("#FFFFFF")
.setDescription('<:Cross:618736602901905418> Enter an item to buy')
message.channel.send(embed3)
}
}
module.exports.help = {
name:"buy",
aliases: [""]
}
`
from quick.db.
Hmm.. In another place in your code you should defined this key with a non-number value I think, like a string.
Search in your code for any files that modify the money_${message.guild.id}_${user.id}
key.
from quick.db.
Unable to reproduce
from quick.db.
Related Issues (20)
- Removing an item from array HOT 2
- Add db.ping() HOT 1
- Starts with function HOT 2
- [Feature Request] Encryption HOT 10
- So I'm making a ban type system for a game from Discord. But.. I get this error. HOT 2
- Bot wont start ERR_DLOPEN_FAILED HOT 2
- invalid ELF header HOT 4
- SyntaxError: Unexpected token '?' on ubuntu HOT 3
- Can you create more than one file HOT 2
- Few questions HOT 3
- Custom Queries HOT 1
- [Bug report] performance issues? im not sure HOT 5
- mySQL update to v8 HOT 3
- `has` method always returns true HOT 2
- Dependency Dashboard
- "Error: connect ETIMEDOUT" HOT 5
- Add data update feature for 2 or more keys
- Could not connect with mongo driver HOT 2
- [Feature Request] Support for cassandra-driver HOT 3
- Pulling an object doesnt work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quick.db.