Really need help that no body is willing too
I was wondering if someone could help me with making a modal. I have made the Modal, but i need help with the event of ModalSubmit thing. I need it to do the profile system. And like turing the Modal into the embed after the Modal has been submitted. Can someone help me with that?
64 Replies
What DJS version?
Djs v14
post is tagged 14.7.0 so...
The latest version
Well yeah thats right
Correct?
i mean that's for you to say, like the post guidelines say, run
npm ls discord.js
I cannot magically spy into your system and see what version you're usingWell i got
"discord.js": "^14.7.1",
Thats true
There we go tags are now correct
@FavnaI have no idea about your problem. I havent used DJS v14 really yet and when I do it's through sapphire...
So what should i do about this?
Cuz i get no where on my own
have you tried joining and asking in the official DJS server? discord.gg/djs
didn't see the tag
Yes i did
many times i have
And no body is really willing or offering for to help me
with this
I think it was changed
I changed it from 14.7.0 to 14.7.1 but for future reference, the whole point of forum posts is to use tags so in the future be sure to check them, always
I think the general idea is:
also, use a unique identifier for
awaitModalSubmit
filter, or 1 user's modal submit will be resolved to otherhuh, I never thought about that
Is it possible for you to join my VScode and help with it?
I mean ill give this a try
By the am getting this error. What does it mean?
That's a napi rs issue, look on their docs to see if your not satisfyingly all their reqs
Ok i got it working.
Can you help me with my Modal please? Ill send the updated code tomorrow when i wake up
Ok
Its giving me this error `
@Lioness100
.... because interaction.ModalSubmit does not exist? I think it's interaction.modalSubmit
SourceBin
interactionCreate.js Modal Builder profile - code and error
Instantly share your code with the world.
It's
.isModalSubmit()
Also the error is saying that there is no field called orientation-input
Ok
Is that means the spelling, right?
maybe
Would you be able to help me with the whole Modal?
sure
Ok is it okay if i invite you to my vscode?
Ill try and do some coding with you.
^
No, sorry I don't have time for that
Ok
Well i got it working actually
One thing how do i make it to where itll mention the role on the embed?
^
You can't have mentions in embeds ping, you'll have to mention the role outside of the embed to
You might be able to get away with mentioning all the roles outside the embed, and then immediately editing the message as to leave only the embed
Well i wanna make it like this
let me get you a ss
The format for a role mention is "<@&id>", so you can either do that and concatenate the role ID, or, if you have the role object from discord.js, just concatenate it directly into a string (for example: `Hello ${role}`), and it will automatically format into a mention
Ohh ok then so would i have to make the role name and id into a const?
.
No, you could either just use the role id as I said above, or the entire role object
For example, both of these would work:
All i want is just have mention the role in an embed. Like the ss i showed.
. But ill try that one
Hi, how do u get the username of the user on a embed? I know its <user>.username but that doesnt work.
Please show code
Ight
And one thing
After this tho
.
That's not how string formatting works. It would be:
Also, you wrote
User
instead of user
when declaring variables, so that will need to changeUnderstanding Template Literals in JavaScript | DigitalOcean
The 2015 edition of the ECMAScript specification (ES6) added template literals to the JavaScript language. Template literals are a new form of making strings…
Ohh ok
@Lioness100 how do you mention a member in interaction.reply?
It's the same as for a role, except it would be
<@
instead of <@&
nah i mean like ping the member
@Lioness100
like that
I know
What I said still applies
await interaction.reply(`${member}`);
Like that?1. No, that's not how template literals are formed, read the article I linked
2. No, as I said in the message, it's either <@${member.id}>, or ${member}. Not a hybrid of both
Hi, if am checking if a member has a specific role, how do i put these roles in an array? idk if this can be possible or not
You can use
member.roles.cache.has('some_id_here')
to check by id, or member.roles.cache.some((role) => ...)
to check by some condition using the role objectIs
if(interaction.user.cache.has_role(role)) {
correct?
^no
interaction.member.roles.cache.has(role.id)
, as I said in my messageOr instead Is
if(interaction.member.cache.some((role) {
Ohh ok
It would be
for (role in member.roles.cache.values())
But an easier way to do that (iterate through every role that both members share) would be for (role in member.roles.cache.intersect(interaction.member.roles.cache).values())
<:_:898645159934316565> Collection#intersect()
The intersect method returns a new structure containing items where the keys and values are present in both original structures.
and then you wouldn't need any check inside the loop
Right?
as I said, if you intersect, you won't need the check inside the loop
Well it seems that it wont send the Embed
^
I can't hold your hand through everything. Do some debugging. Add some log statements and see where the bot stops doing what you want it to do.
FIne ama go find some other server to ask for help, this is not working