Class: KHL::HTTP::GuildMute

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

Overview

服务器静音闭麦相关接口 developer.kaiheila.cn/doc/http/guild

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

#create(guild_id, user_id, type) ⇒ KHL::HTTP::Response

添加服务器静音或闭麦

Parameters:

  • guild_id (String)

    服务器 ID

  • user_id (String)

    用户 ID

  • type (Integer)

    静音类型,1 代表麦克风闭麦,2 代表耳机静音

Returns:



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

def create(guild_id, user_id, type)
  post(guild_id: guild_id, user_id: user_id, type: type)
end

#delete(guild_id, user_id, type) ⇒ KHL::HTTP::Response

删除服务器静音或闭麦

Parameters:

  • guild_id (String)

    服务器 ID

  • user_id (String)

    用户 ID

  • type (Integer)

    静音类型,1 代表麦克风闭麦,2 代表耳机静音

Returns:



33
34
35
# File 'lib/khl/http/guild_mute.rb', line 33

def delete(guild_id, user_id, type)
  post(guild_id: guild_id, user_id: user_id, type: type)
end

#list(guild_id, options = {}) ⇒ KHL::HTTP::Response

服务器静音闭麦列表

Parameters:

  • guild_id (String)

    服务器 ID

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

    可选参数

Options Hash (options):

  • :return_type (String)

    返回格式,建议为 “detail”, 其他情况仅作为兼容

Returns:



15
16
17
# File 'lib/khl/http/guild_mute.rb', line 15

def list(guild_id, options = {})
  get(options.merge(guild_id: guild_id))
end