automatically obtain guildId

how do i obtain guildId automatically ? i'm tired of setting the guildId manually in config
DT
d.js toolkit13d 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! - Marked as resolved by OP
M
mallusrgreat13d ago
guild IDs are how we uniquely identify guilds, any other way and there's a possibility that it isn't unique anymore
A
Avarrice12d ago
i don't really understand that, that means it's impossible for me to obtain it ?
M
mallusrgreat12d ago
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
A
Avarrice12d ago
server ID
K
Kinect300012d ago
Where/how was the config made in the first place?
A
Avarrice12d ago
i did the same as the discord.js guild
A
Avarrice12d ago
i mean this one
No description
𝒄𝒐𝒄𝒐𝒌𝒊𝒕𝒕𝒆𝒏12d ago
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
A
Avarrice11d ago
nvm i already found the solution. thanks everyone
Want results from more Discord servers?
Add your server
More Posts
How can I send a message to this channel?Hey, how can I send a message to this channel? ```js const { Events, EmbedBuilder } = require("discBot Online indicatorHow can I get rid of the green dot on a bot, like how "d.js docs" bot has no online green dot indicaHow do I do this?How do I make it so that I can make a vehicle registration. Ex: Plate: UZP Vehicle Colour: Blue VehERROR DISCPRDAPI/Handlers/Commands.js ```js const { Client } = require("discord.js"); const { GUILDID } = require(".roleUpdate Logs Entires Roles List For A Small Change On One RoleWhenever I Change The Slightest Thing On A Role It Fires The Event And Logs ALL The Roles Is There Problem with Modal Buildersnode:events:497 throw er; // Unhandled 'error' event ^ DiscordAPIError[50035]: Invalid How to send files through broadcastEval?the error is due to an invalid file, the same does not happen when it is sent in the current client Unknown interaction, sometimesThe problem is that sometimes it works and sometimes it generates an error, and I've already tried iI need help with this errorcustom per-guild welcome messagehii, so i wish to make a customized welcome message system for each guild wherein users can customizEmbed and console desyncHello. Im trying to make a reaction role like system for my server. On startup it sends an embed on can anyone help me revise the set position command```ts setPosition(role: MockRole, position: number) { if (position < 0) position = 0; consApplication not responding errorI followed the steps in this website: https://discordjs.guide/creating-your-bot/#using-config-json, command handlermy code in 01registercommands.js ```const { testServer } = require('../../../config.json'); const arSend Embed to Channel with IDI would like to send my embed to a channel specified by ID. Unfortunately it doesn't work in my codeServer Deafen and Mutecan i remove the server deafen and server mute statuses from a user even if they aren't connected tofetch the new created channel```const { SlashCommandBuilder,PermissionFlagsBits } = require('discord.js'); module.exports = { Voice receiver doesn't pick up soundboard soundsI have a pretty fancy discord bot that uses a voice receiver to pick up audio from users. `const au12.5.3 Command not workingHeres my code, any idea why its not working? const Discord = require('discord.js'); const client =How this method works?How `client.application.commands.set()` works to deploy commands? and is an alternative for this? h