#Discriminator turns into "0"

85 messages · Page 1 of 1 (latest)

violet rainBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by OP
shrewd crescent
#

thats intentional behavior

#

users who migrated their username do not have a discriminator anymore

#

no

#

only those who have not migrated their username will still have a discriminator

#

otherwise it will return 0

#

so do that

#

replace discriminator with username

#

yes

lethal cloak
#

If they have a discriminator isn’t their username just their normal username+ discriminator?

lethal cloak
#

John#0001
Is actually
John0001

shrewd crescent
#

not really no

#

only if they chose that username

lethal cloak
#

Ah okay

shrewd crescent
#

unless discord does that automatically if they didnt choose anything

lethal cloak
#

I just figured that since when you look at a user who has not changed it displays as such

shrewd crescent
#

whats "it"

#

can you show your code? i can't guess what you're doing

#

wdym it says tag?

lethal cloak
#

Just to ask what is output look like

shrewd crescent
#

no, what do you mean "it says tag"

#

thats your displayname, not your username

floral ravineBOT
#

property User#displayName
The global name of this user, or their username if they don't have one

lethal cloak
#

Your display name is Trumbus and username is trumbus__

shrewd crescent
#

what?

#

i just showed you

#

use displayName instead of username

lethal cloak
#

^

#

That will output Trumbus instead

shrewd crescent
#

great

#

do you need any more help?

#

if not, please press Mark as Solved at the top of the thread

#

#how-to-get-help

#

having an interactionCreate without actually having slash commands registered doesnt magically make them work

#

you need to register them and then respond accordingly

#

are you responding to the interaction

lethal cloak
#

What is your error?

shrewd crescent
#

again, i can't guess what you're doing. please look at #how-to-get-help

#

thats not an error

#

are you responding to the interaction

lethal cloak
#

Code?

shrewd crescent
#

you defined interaction as another variable

#

you need to destructure commandName from interaction

floral ravineBOT
#

mdn Destructuring assignment
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.

shrewd crescent
#

a class does not equal a string

#

that's not what you were supposed to do

#

do you know javascript?

#

and GuildMember.tag doesnt exist

#

ill ask again, do you know javascript

#

okay then im going to direct you to #resources. using discord.js requires solid js knowledge because otherwise you will have simple errors like this

lethal cloak
shrewd crescent
#

well i did help you

#

you just dont seem to understand anything we're telling you

#

its so simple

#

const { commandName } = interaction;

lethal cloak
#

^

lethal cloak
#

This is the same as
const commandName = interaction.commandName

#

It’s nice to destruct it because you can do many variables at once

#

I also think it looks nicer but that’s just preference

#

Make sure you read the guide it really helps and is fairly beginner friendly

floral ravineBOT
lethal cloak
#

That’s fine global registration takes some time though remember that

shrewd crescent
#

not anymore

lethal cloak
#

Really that’s nice

shrewd crescent
#

do you need any more help?

floral ravineBOT
#

Suggestion for @native reef:
guide Creating Your Bot: Registering slash commands
read more

shrewd crescent
#

you will become rate limited if you register on every restart

#

? use words please

#

it doesnt matter

lethal cloak
#

Yeah you should only register your commands separately when you make changes or add commands

#

I don’t even have it part of my bot so I just run it when I need to

shrewd crescent
#

prefix commands cant be registered

#

they dont need to

lethal cloak
#

Should also move away from prefix commands in my opinion

shrewd crescent
#

again, prefix commands cannot be registered

#

as they do not need to

lethal cloak
#

No I think he is saying he has a prefix command that registers his slash commands

shrewd crescent
#

i mean sure i dont see why not

#

but also, do you need any more help?

lethal cloak
shrewd crescent
#

if not, please mark the thread as solved