Class: Discordrb::Events::InviteDeleteEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/discordrb/events/invites.rb

Overview

Raised when an invite is deleted.

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ InviteDeleteEvent

Returns a new instance of InviteDeleteEvent.


56
57
58
59
60
61
# File 'lib/discordrb/events/invites.rb', line 56

def initialize(data, bot)
  @bot = bot
  @channel = bot.channel(data['channel_id'])
  @server = bot.server(data['guild_id']) if data['guild_id']
  @code = data['code']
end

Instance Attribute Details

#channelChannel (readonly)

Returns The channel the deleted invite was for.

Returns:

  • (Channel)

    The channel the deleted invite was for.


48
49
50
# File 'lib/discordrb/events/invites.rb', line 48

def channel
  @channel
end

#codeString (readonly)

Returns The code of the deleted invite.

Returns:

  • (String)

    The code of the deleted invite.


54
55
56
# File 'lib/discordrb/events/invites.rb', line 54

def code
  @code
end

#serverServer? (readonly)

Returns The server the deleted invite was for.

Returns:

  • (Server, nil)

    The server the deleted invite was for.


51
52
53
# File 'lib/discordrb/events/invites.rb', line 51

def server
  @server
end