#I am trying to get the groups a player is in and then send it in a message with the names
1 messages · Page 1 of 1 (latest)
the object is most likely the group
it's like
class Group()
u can print it to see it's attributes
not sure why u would get an Object when u should probably be getting a json like all the normal apis
is that js
not entirely sure what ${} is
cant help ya then
ye but idk what param .setDescription takes
so consider reading the docs
for whatever package that is
cuz it could be asking for an id
not an object
Why do you have an issue with it returning an object?
you’re trying to turn the object into a string
i’m not really sure what the whole goal of your code is could you clarify that?
- Cant figure out the goal ✅
- Cant figure out the issue ✅
i'm assuming he wants to get the groups names and print em
which would require a for loop over the groups... then simply calling the Name attribute
if u do not know how to do that
https://www.learn-js.org/
^
is a good start
What do you mean its not the groups?
What does it return if not the group stuff.
From the title it seems like this is what you should be using.
Which returns a promise of an array containing the groups a user is in.
he seems to be using it right
Yea I am just confused on what there issue is..
Like it should return this info
this ^
Where they can just get the name.
Yea.
ye he wants to print all the names
which i'm guessing he doesn't know how to loop over the groups
and print the names
Very likely,
@severe bolt idk if u know js
but is it possible to get all the names in a list
without a loop?
like a built-in function of some sorts?
i know it doesn't exist in luau
I don't completely know but I don't think so.
I normally just do a loop.
When I want to get info from an array.
Somthing I quickly made up which should work. Dunno if its the best.
async function SendRequestGetGroups() {
noblox.getGroups(1471902232).then(groupData => {
groupData.forEach(group => {
console.log(group.Name)
})
}).catch(err => {
console.log(err)
})
}
SendRequestGetGroups()```
Can't remember how to format the code correctly in Discord 
add
js
after the first 3 openers
async function SendRequestGetGroups() {
noblox.getGroups(1471902232).then(groupData => {
groupData.forEach(group => {
console.log(group.Name)
})
}).catch(err => {
console.log(err)
})
}
SendRequestGetGroups()
bam
i hate js tbh
it looks so bad ;T
But it just shows that
with js in the text
ye
Its been a long time since I have wrote code on Discord
👍
@severe bolt That should log to the console something such as that so you can just adjust it to ur code.
(the stuff my code logs is the group names)