Ping command help - Beginner
Hi.
I am just a beginner in discord.js. I have done some projects in discord.py.
My problem is that, I cannot get heads or tails to make a Ping command in js. I tried the example in guide too as well as in stackoverflow but, couldn't get it
I know at least i should give an example, but, i cannot cuz no code is usable for me(as far as i saw).
I am thinking of a ping slash command. If u could help me with such a command that has an embed counting the latency and api. It would be helpful for me to understand better.
Also, I am using replit to code.
Sorry for this foolish question. I can't get any better way other than this
22 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
As i said earlier, I am beginner
You should try the code in the guide, and if you have any errors, send them here so we can help you solve them
I can't understand a single thing in that
Do you know JavaScript?
Well, truthfully no. I was just trying.
Then you'd wanna start by learning JavaScript first, check out #resources and #useful-servers, you can't really do much and won't understand anything without learning it
I know that i need to know js. The problem isnt that. The code in guide must work na? I copied it and still it didn't work. Well, am i missing anything?
It does work, "didn't work" doesn't really help us help you solve the issue you're having, any errors?
The guide tells me to create a folder and store the slash cmd there. I stored it and when i search for the slash cmd, there is none
I will try again then
Alright
Well, this is my cmd in index.js
The error
A great example of why you need to learn JavaScript before you continue, you're importing Client twice
Hmmm so, do i have to remove the first
?
The heck. Now i see it, i have made the same code twice
Bruh. Another error came
Lemme try to find
In the code, it says collection isn't defined
#rules 2 and 5
I understand that i come from rule 2 but, not 5
You don't know JavaScript so anyone who'd wanna help would need to hold your hand entirely and explain even basic things
Well, I can't deny it as it's partially true. Hmmmm.... I think py is best suited for me despite just knowing some looping i created codes.....
Hmmmm
Anyway, thnx for ur time
Well, any idea to close this?
Of course, and don't think you need to, it'll close automatically after inactivity
Hmmm ok