Class: Discorb::Invite
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- Discorb::Invite
- Defined in:
- lib/discorb/invite.rb
Overview
Represents invite of discord.
Instance Attribute Summary collapse
-
#approximate_member_count -> Integer
readonly
The approximate number of members of invite.
-
#approximate_presence_count -> Integer
readonly
The approximate number of online users of invite.
-
#channel -> Discorb::Channel?
readonly
Channel of the invite.
-
#code -> String
readonly
The code of invite.
- #created_at -> Time? readonly
- #expires_at -> Time? readonly
-
#guild -> Discorb::Guild?
readonly
Guild of the invite.
- #max_age -> Integer? readonly
- #max_uses -> Integer? readonly
-
#remain_uses -> Integer
readonly
Number of remaining uses of invite.
-
#target_type -> :voice, ...
readonly
The type of invite.
-
#target_user -> User
readonly
The user of invite.
-
#temporary? -> Boolean
readonly
Whether the invite is temporary.
-
#url -> String
readonly
Full url of invite.
- #uses -> Integer? readonly
Instance Method Summary collapse
-
#delete(reason: nil) -> Async::Task<void>
Delete the invite.
Methods inherited from DiscordModel
Instance Attribute Details
#approximate_member_count -> Integer (readonly)
Returns The approximate number of members of invite.
21 22 23 |
# File 'lib/discorb/invite.rb', line 21 def approximate_member_count @approximate_member_count end |
#approximate_presence_count -> Integer (readonly)
Returns The approximate number of online users of invite.
18 19 20 |
# File 'lib/discorb/invite.rb', line 18 def approximate_presence_count @approximate_presence_count end |
#channel -> Discorb::Channel? (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
Channel of the invite.
|
# File 'lib/discorb/invite.rb', line 45
|
#code -> String (readonly)
Returns The code of invite.
9 10 11 |
# File 'lib/discorb/invite.rb', line 9 def code @code end |
#created_at -> Time? (readonly)
43 44 45 |
# File 'lib/discorb/invite.rb', line 43 def created_at @created_at end |
#expires_at -> Time? (readonly)
27 28 29 |
# File 'lib/discorb/invite.rb', line 27 def expires_at @expires_at end |
#guild -> Discorb::Guild? (readonly)
This method returns an object from client cache. it will return nil
if the object is not in cache.
Guild of the invite.
|
# File 'lib/discorb/invite.rb', line 45
|
#max_age -> Integer? (readonly)
39 40 41 |
# File 'lib/discorb/invite.rb', line 39 def max_age @max_age end |
#max_uses -> Integer? (readonly)
35 36 37 |
# File 'lib/discorb/invite.rb', line 35 def max_uses @max_uses end |
#remain_uses -> Integer (readonly)
Number of remaining uses of invite.
|
# File 'lib/discorb/invite.rb', line 45
|
#target_type -> :voice, ... (readonly)
Returns The type of invite.
12 13 14 |
# File 'lib/discorb/invite.rb', line 12 def target_type @target_type end |
#target_user -> User (readonly)
Returns The user of invite.
15 16 17 |
# File 'lib/discorb/invite.rb', line 15 def target_user @target_user end |
#temporary? -> Boolean (readonly)
Whether the invite is temporary.
|
# File 'lib/discorb/invite.rb', line 45
|
#url -> String (readonly)
Full url of invite.
|
# File 'lib/discorb/invite.rb', line 45
|
#uses -> Integer? (readonly)
31 32 33 |
# File 'lib/discorb/invite.rb', line 31 def uses @uses end |
Instance Method Details
#delete(reason: nil) -> Async::Task<void>
Delete the invite.
115 116 117 118 119 |
# File 'lib/discorb/invite.rb', line 115 def delete(reason: nil) Async do @client.http.request(Route.new("/invites/#{@code}", "//invites/:code", :delete), {}, audit_log_reason: reason) end end |