#help with guild fetching
1 messages · Page 1 of 1 (latest)
thanks
<Client>.guild.fetch()
Can you share the entire file?
Can you use codeshare?
I noticed in the snippets you sent that it you used application commands and used guild-related code as well.
The problem is you are using guilds.commands and at the top application.commands
application commands are 'global', so not for any specific guild.
what im doing is im setting perms for slash commands so i need to fetch the guild id im gonna be using and then fetch the perms users have
You can do a loop for all guilds I believe let me look at the docs
client.guilds.cache.forEach()
In case you have multiple guilds I guess
hhm
i cant find the right one tho
got it but
return client.guilds.cache.forEach(permissions)&& !x.managed
^
TypeError: object is not a function
if(!permissions) return null;
return client.guilds.cache.forEach(permissions)&& !x.managed
};```
ohhhhhhhhhhhhhhhhhhhhhhhh i fucked the code up lmaoooooooooooo missing an array
Could be
Also you don't just use foreach on permissions
You need to make an arrow function which will be executed forEACH command
if(!permissions) return null;
return guilds.roles.cache.filter(
(x) => x.permissions.has(permissions) && !x.managed)
}```
now i just have to const guilds and im done i think
return guilds.roles.cache.filter(
^
ReferenceError: guilds is not define
Because you need to fetch them as I said