Class: KHL::HTTP::User

Inherits:
Base
  • Object
show all
Defined in:
lib/khl/http/user.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

#meKHL::HTTP::Response

获取当前用户信息

Returns:



12
13
14
# File 'lib/khl/http/user.rb', line 12

def me
  get
end

#offlineKHL::HTTP::Response

下线机器人

Returns:



27
28
29
# File 'lib/khl/http/user.rb', line 27

def offline
  post
end

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

获取目标用户信息

Parameters:

  • user_id (String)

    用户 ID

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

    可选参数

Options Hash (options):

  • :guild_id (String)

    服务器 ID

Returns:



21
22
23
# File 'lib/khl/http/user.rb', line 21

def view(user_id, options = {})
  get(options.merge(user_id: user_id))
end