Skip to content
This repository was archived by the owner on Mar 25, 2020. It is now read-only.
This repository was archived by the owner on Mar 25, 2020. It is now read-only.

Cannot read property 'members' of undefined #309

Open

Description

@JohnYuZhang

I want to retreive a member status of a specific member through:

var bot = new Discord.Client({
   token: auth.token,
   autorun: true
});
bot.on('ready', function (evt) {
    logger.info('Connected');
    logger.info('Logged in as: ');
    logger.info(bot.username + ' - (' + bot.id + ')');
    console.log(bot.servers[data.serverID].members[data.userID].status)
});

(assuming this is now you get the server id)
image

but it says the members object is undefined.

I've also tried:
bot.getMember(data,function(err,res){console.log(err)} ) which returns an unauthorized error.
name: 'ResponseError',
statusCode: 401,
statusMessage: 'UNAUTHORIZED',
response: { code: 0, message: '401: Unauthorized' } }

The example files on message and presence work fine without any authorization errors.

Activity

  1. changed the title [-]undefined[/-] [+]Cannot read property 'members' of undefined[/+] on Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions