Class: Discordrb::Events::ChannelDeleteEvent

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

Overview

Raised when a channel is deleted

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ ChannelDeleteEvent

Returns a new instance of ChannelDeleteEvent.



83
84
85
86
87
88
89
90
91
92
93
# File 'lib/discordrb/events/channels.rb', line 83

def initialize(data, bot)
  @bot = bot

  @type = data['type']
  @topic = data['topic']
  @position = data['position']
  @name = data['name']
  @is_private = data['is_private']
  @id = data['id'].to_i
  @server = bot.server(data['guild_id'].to_i) if data['guild_id']
end

Instance Attribute Details

#idInteger (readonly)

Returns the channel's ID.

Returns:



78
79
80
# File 'lib/discordrb/events/channels.rb', line 78

def id
  @id
end

#nameString (readonly)

Returns the channel's name.

Returns:

  • (String)

    the channel's name



75
76
77
# File 'lib/discordrb/events/channels.rb', line 75

def name
  @name
end

#positionInteger (readonly)

Returns the position of the channel on the list.

Returns:

  • (Integer)

    the position of the channel on the list



72
73
74
# File 'lib/discordrb/events/channels.rb', line 72

def position
  @position
end

#serverServer (readonly)

Returns the channel's server.

Returns:

  • (Server)

    the channel's server



81
82
83
# File 'lib/discordrb/events/channels.rb', line 81

def server
  @server
end

#topicString (readonly)

Returns the channel's topic.

Returns:

  • (String)

    the channel's topic



69
70
71
# File 'lib/discordrb/events/channels.rb', line 69

def topic
  @topic
end

#typeString (readonly)

Returns the channel's type (text or voice).

Returns:

  • (String)

    the channel's type (text or voice)



66
67
68
# File 'lib/discordrb/events/channels.rb', line 66

def type
  @type
end