Module: Vox::HTTP::Routes::Invite

Defined in:
lib/vox/http/routes/invite.rb

Overview

Mixin for invite routes.

Instance Method Summary collapse

Instance Method Details

#delete_invite(invite_code, reason: nil) ⇒ Hash<Symbol, Object>

Delete an invite by its code.

Parameters:

  • invite_code (String)

Returns:

Required Permissions:

  • MANAGE_CHANNELS or MANAGE_GUILD

View On Discord's Docs:



30
31
32
33
# File 'lib/vox/http/routes/invite.rb', line 30

def delete_invite(invite_code, reason: nil)
  route = Route.new(:DELETE, '/invites/%{invite_code}', invite_code: invite_code)
  request(route, reason: reason)
end

#get_invite(invite_code, with_counts: :undef) ⇒ Hash<Symbol, Object>

Get an invite by its code.

Parameters:

  • invite_code (String)
  • with_counts (true, false) (defaults to: :undef)

    Whether the invite object should contain approximate member counts.

Returns:

View On Discord's Docs:



19
20
21
22
# File 'lib/vox/http/routes/invite.rb', line 19

def get_invite(invite_code, with_counts: :undef)
  route = Route.new(:GET, '/invites/%{invite_code}', invite_code: invite_code)
  request(route, query: filter_undef({ with_counts: with_counts }))
end