Class: Discordrb::Events::InviteCreateEvent
- Defined in:
- lib/discordrb/events/invites.rb
Overview
Raised when an invite is created.
Instance Attribute Summary collapse
-
#channel ⇒ Channel
readonly
The channel the invite was created for.
-
#code ⇒ String
readonly
The code for the created invite.
-
#created_at ⇒ Time
readonly
The time the invite was created at.
-
#invite ⇒ Invite
readonly
The invite that was created.
-
#inviter ⇒ User
readonly
The user that created the invite.
-
#max_age ⇒ Integer
readonly
The maximum age of the created invite.
-
#max_uses ⇒ Integer
readonly
The maximum number of uses before the invite expires.
-
#server ⇒ Server?
readonly
The server the invite was created for.
-
#temporary ⇒ true, false
(also: #temporary?)
readonly
Whether or not this invite grants temporary membership.
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data, invite, bot) ⇒ InviteCreateEvent
constructor
A new instance of InviteCreateEvent.
Constructor Details
#initialize(data, invite, bot) ⇒ InviteCreateEvent
Returns a new instance of InviteCreateEvent.
37 38 39 40 41 42 |
# File 'lib/discordrb/events/invites.rb', line 37 def initialize(data, invite, bot) @bot = bot @invite = invite @channel = bot.channel(data['channel_id']) @server = bot.server(data['guild_id']) if data['guild_id'] end |
Instance Attribute Details
#channel ⇒ Channel (readonly)
Returns The channel the invite was created for.
13 14 15 |
# File 'lib/discordrb/events/invites.rb', line 13 def channel @channel end |
#code ⇒ String (readonly)
Returns The code for the created invite.
33 |
# File 'lib/discordrb/events/invites.rb', line 33 delegate :code, :created_at, :max_age, :max_uses, :temporary, :inviter, to: :invite |
#created_at ⇒ Time (readonly)
Returns The time the invite was created at.
33 |
# File 'lib/discordrb/events/invites.rb', line 33 delegate :code, :created_at, :max_age, :max_uses, :temporary, :inviter, to: :invite |
#invite ⇒ Invite (readonly)
Returns The invite that was created.
7 8 9 |
# File 'lib/discordrb/events/invites.rb', line 7 def invite @invite end |
#inviter ⇒ User (readonly)
Returns The user that created the invite.
33 |
# File 'lib/discordrb/events/invites.rb', line 33 delegate :code, :created_at, :max_age, :max_uses, :temporary, :inviter, to: :invite |
#max_age ⇒ Integer (readonly)
Returns The maximum age of the created invite.
33 |
# File 'lib/discordrb/events/invites.rb', line 33 delegate :code, :created_at, :max_age, :max_uses, :temporary, :inviter, to: :invite |
#max_uses ⇒ Integer (readonly)
Returns The maximum number of uses before the invite expires.
33 |
# File 'lib/discordrb/events/invites.rb', line 33 delegate :code, :created_at, :max_age, :max_uses, :temporary, :inviter, to: :invite |
#server ⇒ Server? (readonly)
Returns The server the invite was created for.
10 11 12 |
# File 'lib/discordrb/events/invites.rb', line 10 def server @server end |
#temporary ⇒ true, false (readonly) Also known as: temporary?
Returns Whether or not this invite grants temporary membership.
33 |
# File 'lib/discordrb/events/invites.rb', line 33 delegate :code, :created_at, :max_age, :max_uses, :temporary, :inviter, to: :invite |