Module: MijDiscord::Core::API::Invite
- Defined in:
- lib/mij-discord/core/api/invite.rb
Class Method Summary collapse
-
.accept(auth, invite_code) ⇒ Object
Join a server using an invite discordapp.com/developers/docs/resources/invite#accept-invite.
-
.delete(auth, code, reason = nil) ⇒ Object
Delete an invite by code discordapp.com/developers/docs/resources/invite#delete-invite.
-
.resolve(auth, invite_code) ⇒ Object
Resolve an invite discordapp.com/developers/docs/resources/invite#get-invite.
Class Method Details
.accept(auth, invite_code) ⇒ Object
Join a server using an invite discordapp.com/developers/docs/resources/invite#accept-invite
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
Delete an invite by code discordapp.com/developers/docs/resources/invite#delete-invite
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
Resolve an invite discordapp.com/developers/docs/resources/invite#get-invite
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 |