How to get value from Object?

  • 0
    I have the Object below
    client: Client {
          _events: [Object: null prototype],
          _eventsCount: 3,
          _maxListeners: undefined,
          _timeouts: [Set],
          _intervals: [Set],
          _immediates: Set(0) {},
          options: [Object],
          rest: [RESTManager],
          ws: [WebSocketManager],
          actions: [ActionsManager],
          voice: [ClientVoiceManager],
          shard: null,
          users: [UserManager],
          guilds: [GuildManager],
          channels: [ChannelManager],
          presence: [ClientPresence],
          user: [ClientUser],
          readyAt: 2020-10-26T19:16:02.906Z,
          config: [Object],
          giveawaysManager: [GiveawaysManager],
          commands: [Collection [Map]],
          [Symbol(kCapture)]: false
        },
        prize: 'test',
        startAt: 1603735911481,
        endAt: 1603735988270,
        ended: true,
        channelID: '769910116656349188',
        messageID: '770348997712937010',
        guildID: '769910116656349185',
        winnerCount: '1',
        hostedBy: '<@488428625247469568>',
        messages: {
          giveaway: '@everyone\n\n�� **РАЗДАЧА** ��',
          giveawayEnded: '@everyone\n\n�� **РАЗДАЧА ЗАКОНЧИЛАСЬ** ��',
          timeRemaining: 'Времени осталось: **{duration}**!',
          inviteToParticipate: 'Нажмите на смайлик � ниже, чтобы участвовать!',
          winMessage: 'Поздравляем, {winners}! ты(вы) выйграл(и) **{prize}**! ',
          embedFooter: 'Раздачи',
          noWinner: 'Розыгрыш отменен, действительных участников нет.',
          hostedBy: 'Сделал раздачу: {user}',
          winners: 'победитель(ей)',
          endedAt: 'Закончился в',
          units: [Object]
        },
        options: {
          messageID: '770348997712937010',
          channelID: '769910116656349188',
          guildID: '769910116656349185',
          startAt: 1603735911481,
          endAt: 1603735988270,
          ended: true,
          winnerCount: '1',
          prize: 'test',
          messages: [Object],
          hostedBy: '<@488428625247469568>'
        },
        message: null,
        [Symbol(kCapture)]: false
      }
    ]


    I want to get options from it, and already in it I want to get the guildID
    I just really need to and I don't know how
    JavaScript Anonymous, Mar 12, 2020

  • 1 Answers
  • 0
    Through a dot, address and output the result to the console, and there it will be clear further, here you just have it written in a strange way. Try it in stages.

    console.log (object.client) then console.log (object.client.options)

    Well, and so on, I think you will understand further))
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!