Checking for specific guild

Hello again.

So, I’ve gotten pretty far in making my bot, but there is one thing I need, and that is to check if a guild is that one specific guild. For example:

If ([current guild] == ExampleGuild1) {
var variable = 1

If the guild was ExampleGuild1, the variable would have been 1, but if the guild was ExampleGuild2, the variable wouldn’t have been. Is there a way to do this?

Thanks in advance!

Looking for the guild id is the best option.

if ( == '12345678987654321') {
  var variable = 1;

To see the id of the guild you need to enable the developer mode

I actually just figured it out. I had just used client instead of message

Hey there!

You can also get a specific guild with client.guilds.get(“id”)

Not sure if this helps, but you learn new things every day!

Happy Glitching!

1 Like