Class: Rubycord::Events::InviteDeleteEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/rubycord/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.



54
55
56
57
58
59
# File 'lib/rubycord/events/invites.rb', line 54

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.



46
47
48
# File 'lib/rubycord/events/invites.rb', line 46

def channel
  @channel
end

#codeString (readonly)

Returns The code of the deleted invite.

Returns:

  • (String)

    The code of the deleted invite.



52
53
54
# File 'lib/rubycord/events/invites.rb', line 52

def code
  @code
end

#serverServer? (readonly)

Returns The server the deleted invite was for.

Returns:

  • (Server, nil)

    The server the deleted invite was for.



49
50
51
# File 'lib/rubycord/events/invites.rb', line 49

def server
  @server
end