N
N
New-Koder-Node-JS2022-04-16 14:09:52
Node.js
New-Koder-Node-JS, 2022-04-16 14:09:52

What to do if it gives users.push an error?

625aa4355e602789504892.jpegI'm writing a script for a game bot and I got an error with users.push!
the error looks like this "users.push"

^
Please help me solve it
I would be very grateful to
everyone who helped!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eshran, 2022-04-24
@eshran

Perhaps the "users" variable is not of a massive type.

let users = []

let [user_info] = await vk.api.users.get({ user_id: message.senderId, fields: 'first_name,last_name' }) 

users.push({
id: message.senderId,
name: user_info.first_name + ' ' + user_info.last_name,
balance: 0
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question