Module: Discordrb::API::Invite

Defined in:
lib/discordrb/api/invite.rb

Overview

API calls for Invite object

Class Method Summary collapse

Class Method Details

.accept(token, invite_code) ⇒ Object


32
33
34
35
36
37
38
39
40
41
# File 'lib/discordrb/api/invite.rb', line 32

def accept(token, invite_code)
  Discordrb::API.request(
    :invite_code,
    nil,
    :post,
    "#{Discordrb::API.api_base}/invite/#{invite_code}",
    nil,
    Authorization: token
  )
end

.delete(token, code, reason = nil) ⇒ Object


19
20
21
22
23
24
25
26
27
28
# File 'lib/discordrb/api/invite.rb', line 19

def delete(token, code, reason = nil)
  Discordrb::API.request(
    :invites_code,
    nil,
    :delete,
    "#{Discordrb::API.api_base}/invites/#{code}",
    Authorization: token,
    'X-Audit-Log-Reason': reason
  )
end

.resolve(token, invite_code) ⇒ Object


7
8
9
10
11
12
13
14
15
# File 'lib/discordrb/api/invite.rb', line 7

def resolve(token, invite_code)
  Discordrb::API.request(
    :invite_code,
    nil,
    :get,
    "#{Discordrb::API.api_base}/invite/#{invite_code}",
    Authorization: token
  )
end