pikachub2005 / replapi-it

A node package that can do anything replit
https://replit.com/@PikachuB2005/replapi-it
9 stars 4 forks source link

Error fetching user #6

Open gooddavvy opened 1 year ago

gooddavvy commented 1 year ago

@pikachub2005 Hi Pika,

This is my Node.js code:

var Client = require('replapi-it');
var client = new Client(process.env.CONNECT_SID_COOKIE);

client.on('ready', async () => {
    let user = await client.users.fetch('GoodnessDavid');
    console.log(user.followerCount);
})

However, when I run it, it says:

` /home/runner/AwesomBot-Generator/node_modules/replapi-it/src/index.js:41 if (!data[0].currentUser) throw new Error('SID is invalid'); ^

TypeError: Cannot read properties of undefined (reading 'currentUser') at /home/runner/AwesomBot-Generator/node_modules/replapi-it/src/index.js:41:17

Node.js v18.12.1 repl process died unexpectedly: exit status 1 `

Here's the repl I'm using, leave a comment and I'll invite you to it: https://replit.com/@GoodnessDavid/AwesomBot-Generator