#you do not understand me
1 messages · Page 1 of 1 (latest)
const config = require("../../../config.json");
const db = require("quick.db");
const { MessageEmbed } = require("discord.js");
const moment = require("moment");
moment.locale("tr");
module.exports = {
name: "darkcointop",
aliases: ["dctop", "cointop"],
execute: async (client, message, args, embed, author, channel, guild) => {
let users = await Users.findAll({ limit: 10, order: [['count', 'DESC']] });
for (const user of users) {
await client.users.fetch(user.userid);
}
users.sort((a, b) => b.balance - a.balance)
.filter(user => client.users.cache.has(user.user_id))
.first(10)
.map((user, position) => `(${position + 1}) ${(client.users.cache.get(user.user_id).tag)}: ${darkcoin:user}`)
.join('\n'),
message.channel.send(ranktop)
}
}```
@young stump
I dont see where you are getting darkcoin from
did you remember to import it
or use your db to get the value
@amber mauve
db.get(`darkcoin:${member.id}`);
I dont see that in your code
replace darkcoin:user with your db.get("darkcoin:${member.id}")
that should work
but remember
darkcoin:user wont change per user
you will need to template string it
along with wherever you update it from
js error
C:\Users\batub\Desktop\DARK CITY BOT'S\Genel - Kopya\src\commands\Genel\darkcointop.js:12
let users = await Users.findAll({ limit: 10, order: [['count', 'DESC']] });
^
ReferenceError: Users is not defined```
the error tells you everything
await delete
Users doesnt exist
?
?
a little
then thats why
wait
quick.db is one database
Users.findAll seems to come from typeORM
so yeah this code isnt gonna work at all
If you do not mind maybe we can do a vsc live share so I can properly see your code?
sure
ok
do you know how to setup a vsc live share?
joining
can I have access to more files?
yeah you are combinding databases
sequelize is an sql db adapter
quick.db is a very bad json db
I am sorry but i cannot help you with an issue with this level of complexity
i have a lot of code how do i change it all
I just want to show the 10 richest people
step 1) read docs
step 2) figure out what needs to be changed
step 3) do it
that is all
You're going to change them all, aren't you?
what about the people with dark coins on the server?
will they all be reset?
then you are going to have to do database migrations
or you can actually figure out what code you are writing before mindlessly copy pasting from the internet
i have no idea what you are saying
db.get(`darkcoin:alluser`)
top 10:
user: 10 darkcoin
user: 8 darkcoin
user: 5 darkcoin
....