Class: KHL::HTTP::Intimacy

Inherits:
Base
  • Object
show all
Defined in:
lib/khl/http/intimacy.rb

Overview

Constant Summary

Constants inherited from Base

Base::API_VERSION, Base::BASE_URL, Base::END_POINT

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#get, #initialize, #post, #post_file

Constructor Details

This class inherits a constructor from KHL::HTTP::Base

Instance Method Details

#index(user_id) ⇒ KHL::HTTP::Response

获取用户亲密度

Parameters:

  • user_id (String)

    用户 ID

Returns:



13
14
15
# File 'lib/khl/http/intimacy.rb', line 13

def index(user_id)
  get(user_id: user_id)
end

#update(user_id, options = {}) ⇒ KHL::HTTP::Response

更新用户亲密度

Parameters:

  • user_id (String)

    用户 ID

  • options (Hash) (defaults to: {})

    可选参数

Options Hash (options):

  • :score (Integer)

    亲密度,0-2200

  • :social_info (String)

    机器人与用户的社交信息,500 字以内

  • :img_id (String)

    表情 ID

Returns:



24
25
26
# File 'lib/khl/http/intimacy.rb', line 24

def update(user_id, options = {})
  post(options.merge(user_id: user_id))
end