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

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.

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