Class: KHL::HTTP::GuildRole
Overview
服务器角色权限相关接口 developer.kaiheila.cn/doc/http/guild-role
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, options = {}) ⇒ KHL::HTTP::Response
创建服务器角色.
-
#delete(guild_id, role_id) ⇒ KHL::HTTP::Response
删除服务器角色.
-
#grant(guild_id, user_id, role_id) ⇒ KHL::HTTP::Response
赋予用户角色.
-
#list(guild_id, options = {}) ⇒ KHL::HTTP::Response
获取服务器角色列表.
-
#revoke(guild_id, user_id, role_id) ⇒ KHL::HTTP::Response
删除用户角色.
-
#update(guild_id, role_id, options = {}) ⇒ 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, options = {}) ⇒ KHL::HTTP::Response
创建服务器角色
25 26 27 |
# File 'lib/khl/http/guild_role.rb', line 25 def create(guild_id, = {}) post(.merge(guild_id: guild_id)) end |
#delete(guild_id, role_id) ⇒ KHL::HTTP::Response
删除服务器角色
47 48 49 |
# File 'lib/khl/http/guild_role.rb', line 47 def delete(guild_id, role_id) post(guild_id: guild_id, role_id: role_id) end |
#grant(guild_id, user_id, role_id) ⇒ KHL::HTTP::Response
赋予用户角色
56 57 58 |
# File 'lib/khl/http/guild_role.rb', line 56 def grant(guild_id, user_id, role_id) post(guild_id: guild_id, user_id: user_id, role_id: role_id) end |
#list(guild_id, options = {}) ⇒ KHL::HTTP::Response
获取服务器角色列表
16 17 18 |
# File 'lib/khl/http/guild_role.rb', line 16 def list(guild_id, = {}) get(.merge(guild_id: guild_id)) end |
#revoke(guild_id, user_id, role_id) ⇒ KHL::HTTP::Response
删除用户角色
65 66 67 |
# File 'lib/khl/http/guild_role.rb', line 65 def revoke(guild_id, user_id, role_id) post(guild_id: guild_id, user_id: user_id, role_id: role_id) end |
#update(guild_id, role_id, options = {}) ⇒ KHL::HTTP::Response
更新服务器角色
39 40 41 |
# File 'lib/khl/http/guild_role.rb', line 39 def update(guild_id, role_id, = {}) post(.merge(guild_id: guild_id, role_id: role_id)) end |