How do I get the current guild id in a client ready event?
I figured it would be client.guild.id but that's undefined. Is there a different way, or can I not access guild in ClientReady?
8 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
discordjs 14.7.1
node 16.14.0
which guild?
would be each guild, but the current guild that's "running"
my plan is use the guild id to store server configs (log channel, bot role level, etc) and was getting the guild ID in ready to do a check if the record was in the db yet, if not create it
that way when someone does say /setlogchannel .. it could pull that guild ID to update that row in teh db
there’s no "current" guild in
ready
eventthat's what I was thinking was the issue. So ill have to do it when the guild is created, ie bot joins
then pull it for each Event
Documentation suggestion for @nahana: (event) Client#guildCreate
Emitted whenever the client joins a guild.
thanks!