automatically obtain guildId
how do i obtain guildId automatically ? i'm tired of setting the guildId manually in config
10 Replies
- 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!
- ✅
Marked as resolved by OPguild IDs are how we uniquely identify guilds, any other way and there's a possibility that it isn't unique anymore
i don't really understand that, that means it's impossible for me to obtain it ?
any identifiers other than the ID of the guild is not unique, if you try to do something with something that is not the guild's id, there's a possibility that it might end up in another guild
server ID
Where/how was the config made in the first place?
i did the same as the discord.js guild
i mean this one
They're talking about their config, so I assume they mean they don't want to manually add the guild IDs of the guilds their bot is in so that they can store guild specific settings.
But you can get the guild id from every interaction, so if you have a setup command or something, u get it from there.
Alternatively there's a guild join event too.
If I didn't totally misunderstand the question lol
nvm i already found the solution. thanks everyone