Class: KHL::HTTP::Channel
Overview
Constant Summary
Constants inherited from Base
Base::API_VERSION, Base::BASE_URL, Base::END_POINT
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(guild_id, name, options = {}) ⇒ KHL::HTTP::Response
创建频道.
-
#delete(channel_id) ⇒ KHL::HTTP::Response
删除频道.
-
#list(guild_id, options = {}) ⇒ KHL::HTTP::Response
获取频道列表.
-
#move_user(target_id, user_ids) ⇒ KHL::HTTP::Response
语音频道之间移动用户.
-
#view(target_id) ⇒ KHL::HTTP::Response
获取频道详情.
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, name, options = {}) ⇒ KHL::HTTP::Response
创建频道
37 38 39 |
# File 'lib/khl/http/channel.rb', line 37 def create(guild_id, name, = {}) post(.merge(guild_id: guild_id, name: name)) end |
#delete(channel_id) ⇒ KHL::HTTP::Response
删除频道
44 45 46 |
# File 'lib/khl/http/channel.rb', line 44 def delete(channel_id) post(channel_id: channel_id) end |
#list(guild_id, options = {}) ⇒ KHL::HTTP::Response
获取频道列表
17 18 19 |
# File 'lib/khl/http/channel.rb', line 17 def list(guild_id, = {}) get(.merge(guild_id: guild_id)) end |
#move_user(target_id, user_ids) ⇒ KHL::HTTP::Response
Note:
只能在语音频道之间移动,用户也必须在其他语音频道在线才能够移动到目标频道
语音频道之间移动用户
53 54 55 |
# File 'lib/khl/http/channel.rb', line 53 def move_user(target_id, user_ids) post(target_id: target_id, user_ids: user_ids) end |
#view(target_id) ⇒ KHL::HTTP::Response
获取频道详情
24 25 26 |
# File 'lib/khl/http/channel.rb', line 24 def view(target_id) get(target_id: target_id) end |