Module: MijDiscord::Core::API::Invite

Defined in:
lib/mij-discord/core/api/invite.rb

Class Method Summary collapse

Class Method Details

.accept(auth, invite_code) ⇒ Object



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

def accept(auth, invite_code)
  MijDiscord::Core::API.request(
    :invite_code,
    nil,
    :post,
    "#{MijDiscord::Core::API::APIBASE_URL}/invites/#{invite_code}",
    nil,
    Authorization: auth
  )
end

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



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

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

.resolve(auth, invite_code) ⇒ Object



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

def resolve(auth, invite_code)
  MijDiscord::Core::API.request(
    :invite_code,
    nil,
    :get,
    "#{MijDiscord::Core::API::APIBASE_URL}/invites/#{invite_code}",
    Authorization: auth
  )
end