Hey i like your system but i don’t Know if with this code you can add an function who’s going to give a role for a user who have reach the level 5 for example , it’s possible ?
hey so whenever I try installing a npm package it shows found 1 high severity vulnerability run `npm audit fix` to fix them, or `npm audit` for details so when I do npm audit fix it says found 1 vulnerbility which needs to be checked manually pls help
What is the reasoning behind giving random amounts of xp per message? Wouldn't you want a constant number that way everyone gains the same? Maybe I am missing something?
do this in const leaderboard = Levels.computeLeaderboard(client, rawLeaderboard); add await so its like this const leaderboard = await Levels.computeLeaderboard(client, rawLeaderboard);
you must write before function async in my code looks like: *Async* run (msg, args) { const rawLeaderboard = await levels.fetchLeaderboard(msg.id, 5) if (rawLeaderboard.length < 1) return reply("W tabeli są pustki! nikt obecnie nie znajduje sie w niej!") const leaderboard = levels.computeLeaderboard(client, rawLeaderboard) const lb = leaderboard.map(e => `${e.position}. ${e.username}#${discriminator} Level:${e.level} XP: ${e.xp.toLocaleString()}`)
msg.channel.send(`${lb.join("
")}`) }, but if you're just doing the tutorial you have to write a function like this: bot.on("message" async message => {... i hope i was help u
Thanks for this tutorial! It really helped me out while making my level bot. My leaderboard command doesn't seem to work though. I put the exact same code as you in my bot, but when I use the command it says '(node:6508) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined'. How do I fix this?
Hi, can u make a video on how to make a website using bootstrap with now-ui-kit. It's help a lot for small bot developers who just want a website and don't know how to start
Hi from Italy. Interesting video, I was thinking about a rank system based on how much time is a person actively connected to vocal channels, so when he's listening or talking (No audiomute). Also to include blacklist channels (and maybe category) like AFK. So working with mongodb there would be a counter in ms which u can show in days/hours/minutes when the user send !rank for example and then work with discord ranks to evolve the user when he reach a particular connected time. Let me know if u think it's a good idea, if there is some package on npm or if something we have to do ourselves. In case feel free to create your own version and maybe make a video on it. It would be crazy. Thanks and have fun.
I'm also using an advanced command handler, but so far it isn't working. When I run the rank command, it gives me an unidentified, and other commands crash the bot.
Great vid but did u know u had a lot of error in your code? Like that [Math.floor(math.random] typo? (Math should be capital M) I also got another error saying leaderboard.map is not a function. Can you help me with that?
Thanks for noticing. I solved the sourcecode. And for ur problem, I would need a sourcecode of urs so I can help you. For more information and easier support, I suggest joining our discord server.
do this in const leaderboard = Levels.computeLeaderboard(client, rawLeaderboard); add await so its like this const leaderboard = await Levels.computeLeaderboard(client, rawLeaderboard);
So I tried it out, but everytime I try to check my rank (or level status), it just shows up as level UNDEFINED. It seems as if the bot isn't giving the user XP whenever they type... How should I go about this?
Hey! Could you add level roles to this or would you have to just make your own system with mongoose and then make your own from there? If you could make level roles with it, how?
It's very simple. In your if(hasLeveledUp), put this: let member = message.author; if(user.level == 1) { message.member.addRole("ROLE_ID"); } You can change the role id and level as you like.
@@petroleystch1676 If you followed the tutorial, you should have a user variable in your if statement. But if you don't have it, here's the code: const user = await Levels.fetch(message.author.id, message.guild.id); Put this at the beginning of the if(hasLeveledUp) statement.
@@Lekrkoekj Oh, ty! message.member.addRole("ROLE ID"); Didn't work "TypeError: message.member.addRole is not a function" so I used: message.member.roles.add("ROLE_ID");
@@Lekrkoekj hey what should I put if I want to make it without like the role id but more like you mention the role if you know what I mean same for the level
msg.channel.send(`You are currently level ${user.level}, your XP is ${user.xp}`) This does If it crashes adding .toString() or .toLocaleString() might do the thing
@@nightstar5994 after the message.channel.send() you just type .then(m => m.delete({timeout: TIME}) you can replace the 'TIME' with sth you want (it has to be in Milliseconds, so If you want 3 seconds, type in 3000)
error :- const hasLeveledUp = await Levels.appendXp(message.author.id, message.guild.id, randomXp); ^^^^^ SyntaxError: await is only valid in async function
Learning from the discord website; Nah
Learning from dashcruft; yes
I learned more than just making a level bot. Thanks!
me: I need a leveling system for my bot.
dashcruft: * uploads leveling system tutorial *
me: oh ok thx
This is pog moment
@@DashCruft yes pog
pog
you are underated man you deserve 1million subs
Hey what about an advancement setup. For example:
"Congratulations! You said 100 times"
You would need a name counter with a database. Each time they say this word, it adds or edit the exist one.
Im getting an error like that: (node:21196) UnhandledPromiseRejectionWarning: TypeError: leaderboard.mapis not a function
imagine dash having ak47 but the bullets are video content and he is shooting at all of us
LMAO
* database thonk sound plays *
Épíç thanks i got to learn something new again
Glad to hear!
Bro I love you mate.
lmfao no worries man
Great vid! Do you think you could do an updated video that gives your roles when you reach a certain level? Also uses the rank card?
Thanks for the idea! I'll see.
@@DashCruft ok thank you so much sorry for @ you in discord 😐. Didn’t mean to upset.
@@Ryan-py7xx I'm not upset at all :)
everyone makes mistakes. Its important to learn from em yk.
@@DashCruft ye
Hey, in my code a random const appeared called levels with small l. It's written like this: *const levels = require('discord-xp/models/levels');*
for me, users only gain xp when they type !rank, they gain no xp when just doing normal chatting. any ideas on why this is?
Hey i like your system but i don’t Know if with this code you can add an function who’s going to give a role for a user who have reach the level 5 for example , it’s possible ?
if (data.level >= 5) {
add role and other stuff here
}
hey so whenever I try installing a npm package it shows
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
so when I do npm audit fix
it says found 1 vulnerbility which needs to be checked manually
pls help
Don’t worry this is just a security issue npm has found. 9/10 it is completely fine
Its all normal. No need to be worried!
What is the reasoning behind giving random amounts of xp per message? Wouldn't you want a constant number that way everyone gains the same? Maybe I am missing something?
Dash can you make a Rank card that includes mongoDB,canvacord and discord-xp package?
Hey im getting an error when i do the leaderboard command it says "UnhandledPromiseRejectionWarning: TypeError: leaderboard.map is not a function"
samee
do this in const leaderboard = Levels.computeLeaderboard(client, rawLeaderboard); add await so its like this
const leaderboard = await Levels.computeLeaderboard(client, rawLeaderboard);
@@ritingeorge5569 i got it its okay lol
Grape video 🍇
Grape is hot
SyntaxError: await is only valid in async function
you must write before function async
in my code looks like:
*Async* run (msg, args) {
const rawLeaderboard = await levels.fetchLeaderboard(msg.id, 5)
if (rawLeaderboard.length < 1) return reply("W tabeli są pustki! nikt obecnie nie znajduje sie w niej!")
const leaderboard = levels.computeLeaderboard(client, rawLeaderboard)
const lb = leaderboard.map(e => `${e.position}. ${e.username}#${discriminator}
Level:${e.level}
XP: ${e.xp.toLocaleString()}`)
msg.channel.send(`${lb.join("
")}`)
},
but if you're just doing the tutorial you have to write a function like this:
bot.on("message" async message => {...
i hope i was help u
u werent using async maybe so like just replace bot.on('message', (message) => with bot.on('message', async (message) =>
@@smartersack thx :)
Thanks for this tutorial! It really helped me out while making my level bot. My leaderboard command doesn't seem to work though. I put the exact same code as you in my bot, but when I use the command it says '(node:6508) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined'.
How do I fix this?
try doing:
cache.get
@@DashCruft Where in the code should I put that?
@@Lekrkoekj Um i would need the full log. join our server so i can help much easier there.
@@DashCruft Oh okay. It's currently midnight for me so I'll join tomorrow.
@@Lekrkoekj 👍
Very epic bro
Hi, can u make a video on how to make a website using bootstrap with now-ui-kit. It's help a lot for small bot developers who just want a website and don't know how to start
Hi from Italy. Interesting video, I was thinking about a rank system based on how much time is a person actively connected to vocal channels, so when he's listening or talking (No audiomute). Also to include blacklist channels (and maybe category) like AFK. So working with mongodb there would be a counter in ms which u can show in days/hours/minutes when the user send !rank for example and then work with discord ranks to evolve the user when he reach a particular connected time. Let me know if u think it's a good idea, if there is some package on npm or if something we have to do ourselves. In case feel free to create your own version and maybe make a video on it. It would be crazy. Thanks and have fun.
can u make a sequel of this which is in a advanced command handler
I have a video on my channel in case you need a command handler.
@@DashCruft I don't need a command handler I have one but will the levelling system still work in the command handler?
@@itsblue6110 It should work on any type of command handler you have. Even if you dont have a command handler, it can still work.
@@DashCruft ok t
I'm also using an advanced command handler, but so far it isn't working. When I run the rank command, it gives me an unidentified, and other commands crash the bot.
Thanks!
Great vid but did u know u had a lot of error in your code? Like that [Math.floor(math.random] typo? (Math should be capital M) I also got another error saying leaderboard.map is not a function. Can you help me with that?
Thanks for noticing. I solved the sourcecode.
And for ur problem, I would need a sourcecode of urs so I can help you.
For more information and easier support, I suggest joining our discord server.
do this in const leaderboard = Levels.computeLeaderboard(client, rawLeaderboard); add await so its like this
const leaderboard = await Levels.computeLeaderboard(client, rawLeaderboard);
@@ritingeorge5569 ty
Hello! I dont know how to get the database link, can you help me?
I keep getting: await is only valid in async function error please help
So I tried it out, but everytime I try to check my rank (or level status), it just shows up as level UNDEFINED. It seems as if the bot isn't giving the user XP whenever they type... How should I go about this?
What should be written in levels.setURL ??
*EPIC*
Yes *EPIC*
Level initialization command is required.
Hey! Could you add level roles to this or would you have to just make your own system with mongoose and then make your own from there? If you could make level roles with it, how?
Yay, thx
Make a video on when someone levels up to a specific level, they'll get a level role for it
It's very simple. In your if(hasLeveledUp), put this:
let member = message.author;
if(user.level == 1) {
message.member.addRole("ROLE_ID");
}
You can change the role id and level as you like.
@@Lekrkoekj Not working for me "ReferenceError: user is not defined"
@@petroleystch1676 If you followed the tutorial, you should have a user variable in your if statement. But if you don't have it, here's the code:
const user = await Levels.fetch(message.author.id, message.guild.id);
Put this at the beginning of the if(hasLeveledUp) statement.
@@Lekrkoekj Oh, ty!
message.member.addRole("ROLE ID"); Didn't work "TypeError: message.member.addRole is not a function" so I used:
message.member.roles.add("ROLE_ID");
@@Lekrkoekj hey what should I put if I want to make it without like the role id but more like you mention the role if you know what I mean same for the level
this is pog
Can u teach me how to script a leveling system which doesnt require just talking but using a command like ?meditate then u gain xp from that?
Wow this is epic i wish I could do that
daily command and stuff? :)
I keep getting an error message that says ''Failed to save new user"
w a t s a m o n g o d b u r l -
Can you also do an economy system tutorial with mongo dB maybe? Hehe
Will try
Wait what do i do with the mongoDb
can you please tell me all the packages nescessary
Any ideas on how to send XP using {prefix}rank?
Example:
user: !rank
bot: You are currently level 0, your XP is 5.
msg.channel.send(`You are currently level ${user.level}, your XP is ${user.xp}`)
This does
If it crashes adding .toString() or .toLocaleString() might do the thing
Epic 😲👌
Yes totally
How would it be to add a role to a certain level?
GG OSM VEDIO
Good ;D!!!
Good video
Thanks
Is fetching an user every time he sends a message an API abuse?
epic
Yes
Thanks, great video! And I'm wondering, how old are you?
Thanks! Why are you asking for my age tho? lol
Alright
how do i give roles on a specific level
npm is not working
Chances are you don't have node.js you can install it here: bit.ly/3dijWJO
Click "Download Node.js and Npm"
Hope this helped :)
hello dashcruft
i am having problem in running the code so can you pls help me with it
im getting error called leaderboard.map is not a function
same
Levels.computeLeaderboard(client, rawLeaderboard).then((users) => {
const embed = new MessageEmbed()
.setColor('#EFFF00')
.setTitle(`Your Leaderboard Title`)
users.map(async(user) => {
embed.addFields(
{ name: `${user.username}`, value: `Rank: #${user.position}
Level: ${user.level}
XP: ${user.xp.toLocaleString()}` })
});
message.channel.send(embed).then(r => r.delete({ timeout: 20000 })).then(messsage.delete());
}, (error) => {
console.log(error).then(messsage.delete());
});
user this
if i do ?lb it says leaderboard.map is not a function how do i fix this?
Add "await" on const leaderbord like --> const leaderboard = await Levels.computeLeaderboard(client, rawLeaderboard);
@@jxcky. ok thanks
I get lb.map is not a function when trying to use leaderboard
You have to make it a capital M
@@idosomething7545 Actually, the solution to the problem was adding an *await* to const leaderboard
Thank you! This solved my issue as well.
Share link for discord server pls i need support the one in description in invalid
tysm
leaderboard.map is not a function dashhhh helpp
got it nvm
@@xaxa-0x3F how
@@shadowwhacc I got it lmaooo
@@xaxa-0x3F nvm i got it too
@@shadowwhacc how?!
xp cannot be defined help
Wait where's the mongoDB? *visible confusion*
MongoDB is a website that is simply a huge database platform online
please can u help ke in setting up a cricket score bot
hi can i ask for the serurl(" ") what do i put inside
what's the solution
Grape video
Not working bro
Please explain ur problem so I can help.
dashcruft can you create anime/manga search command
How to Auto delete msgs of bot with discord. Js?
You meen, if you send a message with the bot, that it deletes after a specific time?
@@RappyyTV yes yes
@@nightstar5994 after the message.channel.send() you just type .then(m => m.delete({timeout: TIME}) you can replace the 'TIME' with sth you want (it has to be in Milliseconds, so If you want 3 seconds, type in 3000)
@@RappyyTV okay!! thanks a lot...
but now I am not coding the bot anymore soo...
anyways tysm..!! 😉
error :- const hasLeveledUp = await Levels.appendXp(message.author.id, message.guild.id, randomXp);
^^^^^
SyntaxError: await is only valid in async function
i think at your index.js file u writed this: bot.on('message', message =>
change it to
bot.on('message', async message =>
this
Please help,i cant download discord-xp
ooof =P
make discord bot music queue and skip, i'll waitin
make video xp voice and up level
Oh damm too bad mine broke when i did something wrong
hey
Howdy
its not working for me
?
@@DashCruft UnhandledPromiseRejectionWarning: Mongo Parse Error: invalid connection string
@@DashCruft Please say me how to fix this UnhandledPromiseRejectionWarning: Mongo Parse Error: invalid connection string
same problem plss help, @DashCruft help me!!! How to fix this error?