Module: Vox::HTTP::Routes::Guild
- Defined in:
- lib/vox/http/routes/guild.rb
Overview
Mixin for guild routes.
Instance Method Summary collapse
-
#add_guild_member(guild_id, user_id, access_token:, nick: :undef, roles: :undef, mute: :undef, deaf: :undef) ⇒ Hash<Symbol, Object>
Add a member using an ‘access_token`.
-
#add_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ nil
Add a role to a guild member.
-
#begin_guild_prune(guild_id, days: :undef, compute_prune_count: :undef, include_roles: :undef, reason: nil) ⇒ Hash<:pruned, (Integer, nil)>
Kick members that have been inactive for a provided duration.
-
#create_guild(name:, region: :undef, icon: :undef, verification_level: :undef, default_message_notifications: :undef, explicit_content_filter: :undef, roles: :undef, channels: :undef, afk_channel_id: :undef, afk_timeout: :undef, system_channel_id: :undef) ⇒ Hash<Symbol, Object>
The created [guild](discord.com/developers/docs/resources/guild#guild-object) object.
-
#create_guild_ban(guild_id, user_id, deleted_message_days: :undef, reason: :undef) ⇒ nil
Ban a user from a guild.
-
#create_guild_channel(guild_id, name: :undef, type: :undef, topic: :undef, bitrate: :undef, user_limit: :undef, rate_limit_per_user: :undef, position: :undef, permission_overwrites: :undef, parent_id: :undef, nsfw: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Create a new channel in a guild.
-
#create_guild_integration(guild_id, type:, id:) ⇒ nil
Create an integration for a guild.
-
#create_guild_role(guild_id, name: :undef, permissions: :undef, color: :undef, hoist: :undef, mentionable: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Create a role in a guild.
-
#delete_guild(guild_id) ⇒ nil
Delete a guild by ID.
-
#delete_guild_integration(guild_id, integration_id, reason: nil) ⇒ nil
Delete a guild integration.
-
#delete_guild_role(guild_id, role_id, reason: nil) ⇒ nil
Delete a guild role.
-
#get_guild(guild_id, with_counts: :undef) ⇒ Hash<Symbol, Object>
Get the guild object for the given ID.
-
#get_guild_ban(guild_id, user_id) ⇒ Hash<Symbol, Object>
Get a ban object for a given user.
-
#get_guild_bans(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of bans for a guild.
-
#get_guild_channels(guild_id) ⇒ Array<Hash<Symbol, Object>>
Get a list of channels for a guild.
-
#get_guild_integrations(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of integrations for a guild.
-
#get_guild_invites(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of invites for a guild.
-
#get_guild_member(guild_id, user_id) ⇒ Hash<Symbol, Object>
Fetch information about a guild member.
-
#get_guild_preview(guild_id) ⇒ Hash<Symbol, Object>
Get a guild preview for a public guild, even if the user is not in the guild.
-
#get_guild_prune_count(guild_id, days: :undef, include_roles: :undef) ⇒ Hash<:pruned, Integer>
Get the result of a potential guild prune.
-
#get_guild_roles(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of roles for a guild.
-
#get_guild_vanity_url(guild_id) ⇒ Hash<(:code, :uses), Object>
Get the vanity url for a guild.
-
#get_guild_voice_regions(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of voice regions for a guild.
-
#get_guild_widget(guild_id) ⇒ Hash<Symbol, Object>
Fetch the guild widget object for a guild.
-
#get_guild_widget_image(guild_id, style: :undef) ⇒ String
Get the widget image of guild.
-
#list_guild_members(guild_id, limit: :undef, after: :undef) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of guild members.
-
#modify_current_user_nick(guild_id, nick: :undef, reason: nil) ⇒ Hash<:name, String>
Update the nickname of the current user on a given guild.
-
#modify_guild(guild_id, name: :undef, region: :undef, verification_level: :undef, default_message_notifications: :undef, explicit_content_filter: :undef, afk_channel_id: :undef, afk_timeout: :undef, icon: :undef, owner_id: :undef, splash: :undef, banner: :undef, system_channel_id: :undef, rules_channel_id: :undef, public_updates_channel_id: :undef, preferred_locale: :undef, reason: nil) ⇒ Hash<Symbol, Object>
The modified [guild](discord.com/developers/docs/resources/guild#guild-object) object.
-
#modify_guild_channel_positions(guild_id, positions, reason: nil) ⇒ nil
Modify the positions of a set of channels.
-
#modify_guild_integration(guild_id, integration_id, expire_behavior: :undef, expire_grace_period: :undef, enable_emoticons: :undef, reason: nil) ⇒ nil
Modify a guild integration.
-
#modify_guild_member(guild_id, user_id, nick: :undef, roles: :undef, mute: :undef, deaf: :undef, channel_id: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Modify attributes of a guild member.
-
#modify_guild_role(guild_id, role_id, name: :undef, permissions: :undef, color: :undef, hoist: :undef, mentionable: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Modify a guild role.
-
#modify_guild_role_positions(guild_id, positions, reason: nil) ⇒ Array<Hash<Symbol, Object>>
Modify the positions of a set of role objects.
-
#modify_guild_widget(guild_id, enabled: :undef, channel_id: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Modify a guild widget object.
-
#remove_guild_ban(guild_id, user_id, reason: nil) ⇒ nil
Unban a user from a guild.
-
#remove_guild_member(guild_id, user_id, reason: nil) ⇒ nil
Kick a member from a guild.
-
#remove_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ nil
Remove a role from a guild member.
-
#sync_guild_integration(guild_id, integration_id, reason: nil) ⇒ nil
Sync a guild integration.
Instance Method Details
#add_guild_member(guild_id, user_id, access_token:, nick: :undef, roles: :undef, mute: :undef, deaf: :undef) ⇒ Hash<Symbol, Object>
Add a member using an ‘access_token`.
205 206 207 208 209 |
# File 'lib/vox/http/routes/guild.rb', line 205 def add_guild_member(guild_id, user_id, access_token:, nick: :undef, roles: :undef, mute: :undef, deaf: :undef) json = filter_undef({ access_token: access_token, nick: nick, roles: roles, mute: mute, deaf: deaf }) route = Route.new(:PUT, '/guilds/%{guild_id}/members/%{user_id}', guild_id: guild_id, user_id: user_id) request(route, json: json) end |
#add_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ nil
Add a role to a guild member.
258 259 260 261 262 |
# File 'lib/vox/http/routes/guild.rb', line 258 def add_guild_member_role(guild_id, user_id, role_id, reason: nil) route = Route.new(:PUT, '/guilds/%{guild_id}/members/%{user_id}/roles/%{role_id}', guild_id: guild_id, user_id: user_id, role_id: role_id) request(route, reason: reason) end |
#begin_guild_prune(guild_id, days: :undef, compute_prune_count: :undef, include_roles: :undef, reason: nil) ⇒ Hash<:pruned, (Integer, nil)>
Kick members that have been inactive for a provided duration.
436 437 438 439 440 441 |
# File 'lib/vox/http/routes/guild.rb', line 436 def begin_guild_prune(guild_id, days: :undef, compute_prune_count: :undef, include_roles: :undef, reason: nil) include_roles = include_roles.is_a?(Array) ? include_roles.join(',') : include_roles json = filter_undef({ days: days, compute_prune_count: compute_prune_count, include_roles: include_roles }) route = Route.new(:POST, '/guilds/%{guild_id}/prune', guild_id: guild_id) request(route, json: json, reason: reason) end |
#create_guild(name:, region: :undef, icon: :undef, verification_level: :undef, default_message_notifications: :undef, explicit_content_filter: :undef, roles: :undef, channels: :undef, afk_channel_id: :undef, afk_timeout: :undef, system_channel_id: :undef) ⇒ Hash<Symbol, Object>
This endpoint can only be used by bots in less than 10 guilds.
When using the ‘roles` parameter, the first member of the array is used to modify the `@everyone` role.
When using the ‘role` parameter, the `id` field in each object is an integer placeholder that will be replaced by the api. The integer placeholder you use is for reference in channel permission overwrites.
When using the ‘channels` parameter, the `position` field is ignored.
When using the ‘channels` parameter, the `id` field is an integer placeholder that will be replaced by the api. This is used for `GUILD_CATEGORY` channel types to allow you to reference a `parent_id` in other channels.
Returns The created [guild](discord.com/developers/docs/resources/guild#guild-object) object.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/vox/http/routes/guild.rb', line 38 def create_guild(name:, region: :undef, icon: :undef, verification_level: :undef, default_message_notifications: :undef, explicit_content_filter: :undef, roles: :undef, channels: :undef, afk_channel_id: :undef, afk_timeout: :undef, system_channel_id: :undef) json = filter_undef( { name: name, region: region, icon: icon, verification_level: verification_level, default_message_notifications: , explicit_content_filter: explicit_content_filter, roles: roles, channels: channels, afk_channel_id: afk_channel_id, afk_timeout: afk_timeout, system_channel_id: system_channel_id } ) request(Route.new(:POST, '/guilds'), json: json) end |
#create_guild_ban(guild_id, user_id, deleted_message_days: :undef, reason: :undef) ⇒ nil
Ban a user from a guild.
319 320 321 322 323 |
# File 'lib/vox/http/routes/guild.rb', line 319 def create_guild_ban(guild_id, user_id, deleted_message_days: :undef, reason: :undef) json = filter_undef({ deleted_message_days: , reason: reason }) route = Route.new(:PUT, '/guilds/%{guild_id}/bans/%{user_id}', guild_id: guild_id, user_id: user_id) request(route, json: json) end |
#create_guild_channel(guild_id, name: :undef, type: :undef, topic: :undef, bitrate: :undef, user_limit: :undef, rate_limit_per_user: :undef, position: :undef, permission_overwrites: :undef, parent_id: :undef, nsfw: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Create a new channel in a guild.
149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/vox/http/routes/guild.rb', line 149 def create_guild_channel(guild_id, name: :undef, type: :undef, topic: :undef, bitrate: :undef, user_limit: :undef, rate_limit_per_user: :undef, position: :undef, permission_overwrites: :undef, parent_id: :undef, nsfw: :undef, reason: nil) json = filter_undef( { name: name, type: type, topic: topic, bitrate: bitrate, user_limit: user_limit, rate_limit_per_user: rate_limit_per_user, position: position, permission_overwrites: , parent_id: parent_id, nsfw: nsfw } ) request(Route.new(:POST, '/guilds/%{guild_id}/channels', guild_id: guild_id), json: json, reason: reason) end |
#create_guild_integration(guild_id, type:, id:) ⇒ nil
Create an integration for a guild.
480 481 482 483 |
# File 'lib/vox/http/routes/guild.rb', line 480 def create_guild_integration(guild_id, type:, id:) json = { type: type, id: id } request(Route.new(:POST, '/guilds/%{guild_id}/integrations', guild_id: guild_id), json: json) end |
#create_guild_role(guild_id, name: :undef, permissions: :undef, color: :undef, hoist: :undef, mentionable: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Create a role in a guild.
358 359 360 361 362 363 |
# File 'lib/vox/http/routes/guild.rb', line 358 def create_guild_role(guild_id, name: :undef, permissions: :undef, color: :undef, hoist: :undef, mentionable: :undef, reason: nil) json = filter_undef({ name: name, permissions: , color: color, hoist: hoist, mentionable: mentionable }) request(Route.new(:POST, '/guilds/%{guild_id}/roles', guild_id: guild_id), json: json, reason: reason) end |
#delete_guild(guild_id) ⇒ nil
The user must be the server owner.
Delete a guild by ID.
116 117 118 |
# File 'lib/vox/http/routes/guild.rb', line 116 def delete_guild(guild_id) request(Route.new(:DELETE, '/guilds/%{guild_id}', guild_id: guild_id)) end |
#delete_guild_integration(guild_id, integration_id, reason: nil) ⇒ nil
Delete a guild integration.
513 514 515 516 517 |
# File 'lib/vox/http/routes/guild.rb', line 513 def delete_guild_integration(guild_id, integration_id, reason: nil) route = Route.new(:DELETE, '/guilds/%{guild_id}/integrations/%{integration_id}', guild_id: guild_id, integration_id: integration_id) request(route, reason: reason) end |
#delete_guild_role(guild_id, role_id, reason: nil) ⇒ nil
Delete a guild role.
406 407 408 409 |
# File 'lib/vox/http/routes/guild.rb', line 406 def delete_guild_role(guild_id, role_id, reason: nil) route = Route.new(:DELETE, '/guilds/%{guild_id}/roles/%{role_id}', guild_id: guild_id, role_id: role_id) request(route, reason: reason) end |
#get_guild(guild_id, with_counts: :undef) ⇒ Hash<Symbol, Object>
Get the guild object for the given ID.
60 61 62 63 |
# File 'lib/vox/http/routes/guild.rb', line 60 def get_guild(guild_id, with_counts: :undef) params = filter_undef({ with_counts: with_counts }) request(Route.new(:GET, '/guilds/%{guild_id}', guild_id: guild_id), query: params) end |
#get_guild_ban(guild_id, user_id) ⇒ Hash<Symbol, Object>
Get a ban object for a given user.
307 308 309 |
# File 'lib/vox/http/routes/guild.rb', line 307 def get_guild_ban(guild_id, user_id) request(Route.new(:GET, '/guilds/%{guild_id}/bans/%{user_id}', guild_id: guild_id, user_id: user_id)) end |
#get_guild_bans(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of bans for a guild.
296 297 298 |
# File 'lib/vox/http/routes/guild.rb', line 296 def get_guild_bans(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/bans', guild_id: guild_id)) end |
#get_guild_channels(guild_id) ⇒ Array<Hash<Symbol, Object>>
Get a list of channels for a guild.
125 126 127 |
# File 'lib/vox/http/routes/guild.rb', line 125 def get_guild_channels(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/channels', guild_id: guild_id)) end |
#get_guild_integrations(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of integrations for a guild.
469 470 471 |
# File 'lib/vox/http/routes/guild.rb', line 469 def get_guild_integrations(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/integrations', guild_id: guild_id)) end |
#get_guild_invites(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of invites for a guild.
459 460 461 |
# File 'lib/vox/http/routes/guild.rb', line 459 def get_guild_invites(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/invites', guild_id: guild_id)) end |
#get_guild_member(guild_id, user_id) ⇒ Hash<Symbol, Object>
Fetch information about a guild member.
181 182 183 |
# File 'lib/vox/http/routes/guild.rb', line 181 def get_guild_member(guild_id, user_id) request(Route.new(:GET, '/guilds/%{guild_id}/members/%{user_id}', guild_id: guild_id, user_id: user_id)) end |
#get_guild_preview(guild_id) ⇒ Hash<Symbol, Object>
This endpoint is only for public guilds.
Get a guild preview for a public guild, even if the user is not in the guild.
71 72 73 |
# File 'lib/vox/http/routes/guild.rb', line 71 def get_guild_preview(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/preview', guild_id: guild_id)) end |
#get_guild_prune_count(guild_id, days: :undef, include_roles: :undef) ⇒ Hash<:pruned, Integer>
Get the result of a potential guild prune.
419 420 421 422 423 |
# File 'lib/vox/http/routes/guild.rb', line 419 def get_guild_prune_count(guild_id, days: :undef, include_roles: :undef) include_roles = include_roles.is_a?(Array) ? include_roles.join(',') : include_roles params = filter_undef({ days: days, include_roles: include_roles }) request(Route.new(:GET, '/guilds/%{guild_id}/prune', guild_id: guild_id), query: params) end |
#get_guild_roles(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of roles for a guild.
342 343 344 |
# File 'lib/vox/http/routes/guild.rb', line 342 def get_guild_roles(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/roles', guild_id: guild_id)) end |
#get_guild_vanity_url(guild_id) ⇒ Hash<(:code, :uses), Object>
Get the vanity url for a guild.
564 565 566 |
# File 'lib/vox/http/routes/guild.rb', line 564 def get_guild_vanity_url(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/vanity-url', guild_id: guild_id)) end |
#get_guild_voice_regions(guild_id) ⇒ Array<Hash<Symbol, Object>>
Fetch a list of voice regions for a guild.
448 449 450 |
# File 'lib/vox/http/routes/guild.rb', line 448 def get_guild_voice_regions(guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/regions', guild_id: guild_id)) end |
#get_guild_widget(guild_id) ⇒ Hash<Symbol, Object>
Fetch the guild widget object for a guild.
538 539 540 |
# File 'lib/vox/http/routes/guild.rb', line 538 def (guild_id) request(Route.new(:GET, '/guilds/%{guild_id}/widget', guild_id: guild_id)) end |
#get_guild_widget_image(guild_id, style: :undef) ⇒ String
Get the widget image of guild.
574 575 576 577 578 |
# File 'lib/vox/http/routes/guild.rb', line 574 def (guild_id, style: :undef) params = filter_undef({ style: style }) route = Route.new(:GET, '/guilds/%{guild_id}/widget.png', guild_id: guild_id) request(route, query: params, raw: true) end |
#list_guild_members(guild_id, limit: :undef, after: :undef) ⇒ Array<Hash<Symbol, Object>>
In the future this will require [priviledged intents](discord.com/developers/docs/topics/gateway#privileged-intents).
Fetch a list of guild members.
193 194 195 196 |
# File 'lib/vox/http/routes/guild.rb', line 193 def list_guild_members(guild_id, limit: :undef, after: :undef) params = filter_undef({ limit: limit, after: after }) request(Route.new(:GET, '/guilds/%{guild_id}/members', guild_id: guild_id), query: params) end |
#modify_current_user_nick(guild_id, nick: :undef, reason: nil) ⇒ Hash<:name, String>
Update the nickname of the current user on a given guild.
244 245 246 247 248 |
# File 'lib/vox/http/routes/guild.rb', line 244 def modify_current_user_nick(guild_id, nick: :undef, reason: nil) json = filter_undef({ nick: nick }) route = Route.new(:PATCH, '/guilds/%{guild_id}/members/@me/nick', guild_id: guild_id) request(route, json: json, reason: reason) end |
#modify_guild(guild_id, name: :undef, region: :undef, verification_level: :undef, default_message_notifications: :undef, explicit_content_filter: :undef, afk_channel_id: :undef, afk_timeout: :undef, icon: :undef, owner_id: :undef, splash: :undef, banner: :undef, system_channel_id: :undef, rules_channel_id: :undef, public_updates_channel_id: :undef, preferred_locale: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Returns The modified [guild](discord.com/developers/docs/resources/guild#guild-object) object.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vox/http/routes/guild.rb', line 92 def modify_guild(guild_id, name: :undef, region: :undef, verification_level: :undef, default_message_notifications: :undef, explicit_content_filter: :undef, afk_channel_id: :undef, afk_timeout: :undef, icon: :undef, owner_id: :undef, splash: :undef, banner: :undef, system_channel_id: :undef, rules_channel_id: :undef, public_updates_channel_id: :undef, preferred_locale: :undef, reason: nil) json = filter_undef( { name: name, region: region, verification_level: verification_level, default_message_notifications: , explicit_content_filter: explicit_content_filter, afk_channel_id: afk_channel_id, afk_timeout: afk_timeout, icon: icon, owner_id: owner_id, splash: splash, banner: , system_channel_id: system_channel_id, rules_channel_id: rules_channel_id, public_updates_channel_id: public_updates_channel_id, preferred_locale: preferred_locale } ) request(Route.new(:PATCH, '/guilds/%{guild_id}', guild_id: guild_id), json: json, reason: reason) end |
#modify_guild_channel_positions(guild_id, positions, reason: nil) ⇒ nil
Only channels to be modified are required, with the minimum count being two channels.
Modify the positions of a set of channels.
170 171 172 173 |
# File 'lib/vox/http/routes/guild.rb', line 170 def modify_guild_channel_positions(guild_id, positions, reason: nil) route = Route.new(:PATCH, '/guilds/%{guild_id}/channels', guild_id: guild_id) request(route, json: positions, reason: reason) end |
#modify_guild_integration(guild_id, integration_id, expire_behavior: :undef, expire_grace_period: :undef, enable_emoticons: :undef, reason: nil) ⇒ nil
Modify a guild integration.
497 498 499 500 501 502 503 504 |
# File 'lib/vox/http/routes/guild.rb', line 497 def modify_guild_integration(guild_id, integration_id, expire_behavior: :undef, expire_grace_period: :undef, enable_emoticons: :undef, reason: nil) json = filter_undef({ expire_behavior: expire_behavior, expire_grace_period: expire_grace_period, enable_emoticons: enable_emoticons }) route = Route.new(:PATCH, '/guilds/%{guild_id}/integrations/%{integration_id}', guild_id: guild_id, integration_id: integration_id) request(route, json: json, reason: reason) end |
#modify_guild_member(guild_id, user_id, nick: :undef, roles: :undef, mute: :undef, deaf: :undef, channel_id: :undef, reason: nil) ⇒ Hash<Symbol, Object>
‘mute` and `deaf` parameters will result in a Error::BadRequest if the target user is not in a voice channel.
When moving members to channels, the API user must have permissions to connect to both channels as well as MOVE_MEMBERS
Modify attributes of a guild member.
230 231 232 233 234 235 |
# File 'lib/vox/http/routes/guild.rb', line 230 def modify_guild_member(guild_id, user_id, nick: :undef, roles: :undef, mute: :undef, deaf: :undef, channel_id: :undef, reason: nil) json = filter_undef({ nick: nick, roles: roles, mute: mute, deaf: deaf, channel_id: channel_id }) route = Route.new(:PATCH, '/guilds/%{guild_id}/members/%{user_id}', guild_id: guild_id, user_id: user_id) request(route, json: json, reason: reason) end |
#modify_guild_role(guild_id, role_id, name: :undef, permissions: :undef, color: :undef, hoist: :undef, mentionable: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Modify a guild role.
391 392 393 394 395 396 397 |
# File 'lib/vox/http/routes/guild.rb', line 391 def modify_guild_role(guild_id, role_id, name: :undef, permissions: :undef, color: :undef, hoist: :undef, mentionable: :undef, reason: nil) json = filter_undef({ name: name, permissions: , color: color, hoist: hoist, mentionable: mentionable }) route = Route.new(:PATCH, '/guilds/%{guild_id}/roles/%{role_id}', guild_id: guild_id, role_id: role_id) request(route, json: json, reason: reason) end |
#modify_guild_role_positions(guild_id, positions, reason: nil) ⇒ Array<Hash<Symbol, Object>>
Modify the positions of a set of role objects.
373 374 375 |
# File 'lib/vox/http/routes/guild.rb', line 373 def modify_guild_role_positions(guild_id, positions, reason: nil) request(Route.new(:PATCH, '/guilds/%{guild_id}/roles', guild_id: guild_id), json: positions, reason: reason) end |
#modify_guild_widget(guild_id, enabled: :undef, channel_id: :undef, reason: nil) ⇒ Hash<Symbol, Object>
Modify a guild widget object.
551 552 553 554 555 |
# File 'lib/vox/http/routes/guild.rb', line 551 def (guild_id, enabled: :undef, channel_id: :undef, reason: nil) json = filter_undef({ enabled: enabled, channel_id: channel_id }) route = Route.new(:PATCH, '/guilds/%{guild_id}/widget', guild_id: guild_id) request(route, json: json, reason: reason) end |
#remove_guild_ban(guild_id, user_id, reason: nil) ⇒ nil
Unban a user from a guild.
332 333 334 335 |
# File 'lib/vox/http/routes/guild.rb', line 332 def remove_guild_ban(guild_id, user_id, reason: nil) route = Route.new(:DELETE, '/guilds/%{guild_id}/bans/%{user_id}', guild_id: guild_id, user_id: user_id) request(route, reason: reason) end |
#remove_guild_member(guild_id, user_id, reason: nil) ⇒ nil
Kick a member from a guild.
285 286 287 288 |
# File 'lib/vox/http/routes/guild.rb', line 285 def remove_guild_member(guild_id, user_id, reason: nil) route = Route.new(:DELETE, '/guilds/%{guild_id}/members/%{user_id}', guild_id: guild_id, user_id: user_id) request(route, reason: reason) end |
#remove_guild_member_role(guild_id, user_id, role_id, reason: nil) ⇒ nil
Remove a role from a guild member.
272 273 274 275 276 |
# File 'lib/vox/http/routes/guild.rb', line 272 def remove_guild_member_role(guild_id, user_id, role_id, reason: nil) route = Route.new(:DELETE, '/guilds/%{guild_id}/members/%{user_id}/roles/%{role_id}', guild_id: guild_id, user_id: user_id, role_id: role_id) request(route, reason: reason) end |
#sync_guild_integration(guild_id, integration_id, reason: nil) ⇒ nil
Sync a guild integration.
526 527 528 529 530 |
# File 'lib/vox/http/routes/guild.rb', line 526 def sync_guild_integration(guild_id, integration_id, reason: nil) route = Route.new(:POST, '/guilds/%{guild_id}/integrations/%{integration_id}/sync', guild_id: guild_id, integration_id: integration_id) request(route, reason: reason) end |