Discord bot only gives role to me

Here is the log I received with console.log(message.guild.members.cache.filter(m => !m.user.bot));:

Collection [Map] {
  '759457326251114536' => GuildMember {
    guild: Guild {
      members: [GuildMemberManager],
      channels: [GuildChannelManager],
      roles: [RoleManager],
      presences: [PresenceManager],
      voiceStates: [VoiceStateManager],
      deleted: false,
      available: true,
      id: '760015259619819550',
      shardID: 0,
      name: 'GoodGameBTWâ„¢',
      icon: '5c364ec985a0706a27c31b89953d01e4',
      splash: null,
      discoverySplash: null,
      region: 'india',
      memberCount: 10,
      large: false,
      features: [Array],
      applicationID: null,
      afkTimeout: 300,
      afkChannelID: null,
      systemChannelID: null,
      embedEnabled: undefined,
      premiumTier: 0,
      premiumSubscriptionCount: 0,
      verificationLevel: 'LOW',
      explicitContentFilter: 'ALL_MEMBERS',
      mfaLevel: 0,
      joinedTimestamp: 1603042420216,
      defaultMessageNotifications: 'MENTIONS',
      systemChannelFlags: [SystemChannelFlags],
      maximumMembers: 100000,
      vanityURLCode: null,
      vanityURLUses: null,
      description: null,
      banner: null,
      rulesChannelID: '771729349632196608',
      publicUpdatesChannelID: '768502471676788777',
      preferredLocale: 'en-US',
      ownerID: '759457326251114536',
      emojis: [GuildEmojiManager]
    },
    joinedTimestamp: 1601272158336,
    lastMessageID: '773102408938029056',
    lastMessageChannelID: '760778837612822558',
    premiumSinceTimestamp: 0,
    deleted: false,
    nickname: null,
    _roles: [ '760763514402111488', '760759896232296468' ],
    user: User {
      id: '759457326251114536',
      username: 'Prof. MineKraft',
      bot: false,
      discriminator: '6612',
      avatar: '97ee817e5098d3e6ee4c174a449d1779',
      flags: [UserFlags],
      lastMessageID: '773102408938029056',
      lastMessageChannelID: '760778837612822558'
    }
  }
}

From the log, you can see that the cache has only two users, the bot and you. So when you filter the bot out, only you get the role.

This can be because you have gateway intents disabled. Please go to the discord developer portal and enable the Server member intent. That should fix your problem.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top