B
B
botvkjsr2021-05-12 17:53:55
In contact with
botvkjsr, 2021-05-12 17:53:55

Variable undefined?

Good evening! When I run the code, I get the error "Handle polling update error: TypeError: Cannot read property 'nektarcv' of undefined" (photo below).
The code itself:

///переменные прикреплены ниже

cmd.ricco(/^(?:цветок|мой цветок|цветы|цветочек)$/i, async (message, bot) => {  

  return bot(`информация о вашем цветке:
    Название: Тюльпан

    Нектара: ${utils.sp(message.user.cvetok.nektarcv)} - (${utils.sp(message.user.cvetok.nektarcv)} в час)

    Цена за улучшение цветка: ${utils.sp(message.user.cvetok.cenacv)}$`)

});

Bug photo: 609beae2c5a85806492623.png
Variables from code: 609beb4a8887e841941887.png
Please help solve the problem. It's not just with this code. When I start doing something else, I get the same error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Confy, 2021-05-12
@botvkjsr

At message.usersome point missing cvetok. Maybe he never shows up. Why there is no flower - find out for you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question