Checkuser Discord Bot Script

Here is my code; https://srcb.in/ZkESYt2gnk a easy to read description of what I'm tryna do with this script is Check's Roblox User Profile & Pulls Information Through a Discord Bot I'm currently using Discord.Js, TS, and it's being hosted on Repl.it rn. what's wrong? the script runs fine the issue is that I want the text embed gui that appears when running the command to show the Group Rank feature which it's currently not i've been workin on this for hours if anyone knows what I'm doing wrong or where I could try to fix it next plz lmk
SourceBin
Checkuser Script
Check's Roblox User Profile & Pulls Information Through a Discord Bot I'm currently using Discord.Js, TS, and it's being hosted on Repl.it rn
37 Replies
d.js toolkit
d.js toolkitā€¢11mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - 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!
Dusk
DuskOPā€¢11mo ago
Here's what appears currently when I run it
No description
Dusk
DuskOPā€¢11mo ago
Here's what I want to appear except for the Group Rank: to display the User's Rolename in the Group
Dusk
DuskOPā€¢11mo ago
No description
treble/luna
treble/lunaā€¢11mo ago
first of all why do you have 2 and second, you define it but you never do anything with it so it will always be undefined
Dusk
DuskOPā€¢11mo ago
I just realized I have 2 idk why I have 2 Well I want to call it without using a slash alt option command like Groups is displayed without me using groups in the slash command
treble/luna
treble/lunaā€¢11mo ago
options have nothing to do with it you define the variable but you never do anything with it so yes, that will always be undefined and thus return
Dusk
DuskOPā€¢11mo ago
ok it's let groupDataValue I gotta store it in then update the embed
treble/luna
treble/lunaā€¢11mo ago
again you indeed define it but you never do anything with it
Dusk
DuskOPā€¢11mo ago
ok i'm honestly confused and would like to share my thinking I believe what you're telling me to do is set it up like I did username or robloxID in which the data is being called through the variable
treble/luna
treble/lunaā€¢11mo ago
this is what you have and thats it you never reassign it
Dusk
DuskOPā€¢11mo ago
https://srcb.in/pOSvOSYH0N I've made adjustmnets i'm still not sure what to do I understand that they are not reassigned but idk what to reassign them to idk if I should delete them or what
SourceBin
Checkuser Script
Check's Roblox User Profile & Pulls Information Through a Discord Bot I'm currently using Discord.Js, TS, and it's being hosted on Repl.it rn
Dusk
DuskOPā€¢11mo ago
I don't want the answer but can you push me another hint of what I need to specifically solve to get a step closer i'm still learning and I just have been at this for hours I appreciate your help but im just lost
treble/luna
treble/lunaā€¢11mo ago
i mean its pretty simple you never do anything with your variables so how do you expect them to hold any value
Dusk
DuskOPā€¢11mo ago
ok so ive been doing more thinking and testing I haven't solved it yet but I made adjustments like u mentioned one I did use the same variable and stored different information in it so it was overshadowed I fixed that
Dusk
DuskOPā€¢11mo ago
SourceBin
Checkuser Script
Check's Roblox User Profile & Pulls Information Through a Discord Bot I'm currently using Discord.Js, TS, and it's being hosted on Repl.it rn
Dusk
DuskOPā€¢11mo ago
Here's my updated code I feel some of it maybe doing the same thing but Its only because I want to still access the slash alt command option and it pulls similar data my code still doesn't do what I want and Idk why especially since it's got a value stored and it's not embedding it
Dusk
DuskOPā€¢11mo ago
https://srcb.in/dhe2VjxTxl - Updated script again can someone give me another hint at what part of my code I need to look at I've done numerous edits and still no results
SourceBin
Checkuser Script
Check's Roblox User Profile & Pulls Information Through a Discord Bot I'm currently using Discord.Js, TS, and it's being hosted on Repl.it rn
trustfunds
trustfundsā€¢11mo ago
lemme keep it nice and simple for you
trustfunds
trustfundsā€¢11mo ago
No description
trustfunds
trustfundsā€¢11mo ago
here you define groupDataValue
Dusk
DuskOPā€¢11mo ago
yes
trustfunds
trustfundsā€¢11mo ago
but throughout all of the proceeding code up until the point you use the selection statement on like 149 you dont put anything in that variable
trustfunds
trustfundsā€¢11mo ago
No description
trustfunds
trustfundsā€¢11mo ago
an empty string is falsy so it will not run this section of code you need to put something into that variable
Dusk
DuskOPā€¢11mo ago
like a boolean?
trustfunds
trustfundsā€¢11mo ago
no what are you expecting to be in that variable you need to dynamically get the data for that profile
Dusk
DuskOPā€¢11mo ago
Group Rank
trustfunds
trustfundsā€¢11mo ago
then you nmeed to get that data
Dusk
DuskOPā€¢11mo ago
SourceBin
Checkuser Script
Check's Roblox User Profile & Pulls Information Through a Discord Bot I'm currently using Discord.Js, TS, and it's being hosted on Repl.it rn
Dusk
DuskOPā€¢11mo ago
I've gone and inputted the proper data, but does it have to require a slash command for group as well, or is there a work around?
trustfunds
trustfundsā€¢11mo ago
you could use a string template instead of doing this šŸ˜‚
let groupDataValue = '\nRank Name: <rank name>'.replace("<rank name>", await roblox.getRankNameInGroup(groupID, robloxID));
let groupDataValue = '\nRank Name: <rank name>'.replace("<rank name>", await roblox.getRankNameInGroup(groupID, robloxID));
Dusk
DuskOPā€¢11mo ago
Iā€™m still learning and I finally got the code to work and have implemented some more features I wanted, If a string templates easier I can try to implement it
trustfunds
trustfundsā€¢11mo ago
its dead simple mate for example
const world = 'world';
console.log(`Hello ${world}`); // prints hello world
const world = 'world';
console.log(`Hello ${world}`); // prints hello world
d.js docs
d.js docsā€¢11mo ago
mdn Template literals (Template strings) Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.
Want results from more Discord servers?
Add your server