Class: Discordrb::Events::ChannelDeleteEvent
- Defined in:
- lib/discordrb/events/channels.rb
Overview
Raised when a channel is deleted
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
The channel’s ID.
-
#name ⇒ String
readonly
The channel’s name.
-
#owner_id ⇒ Integer?
readonly
The channel’s owner ID if this is a group channel.
-
#position ⇒ Integer
readonly
The position of the channel on the list.
-
#server ⇒ Server
readonly
The channel’s server.
-
#topic ⇒ String
readonly
The channel’s topic.
-
#type ⇒ Integer
readonly
The channel’s type (0: text, 1: private, 2: voice, 3: group).
Attributes inherited from Event
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ ChannelDeleteEvent
constructor
A new instance of ChannelDeleteEvent.
Constructor Details
#initialize(data, bot) ⇒ ChannelDeleteEvent
Returns a new instance of ChannelDeleteEvent.
86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/discordrb/events/channels.rb', line 86 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'] @owner_id = bot.user(data['owner_id']) if @type == 3 end |
Instance Attribute Details
#id ⇒ Integer (readonly)
Returns the channel’s ID.
78 79 80 |
# File 'lib/discordrb/events/channels.rb', line 78 def id @id end |
#name ⇒ String (readonly)
Returns the channel’s name.
75 76 77 |
# File 'lib/discordrb/events/channels.rb', line 75 def name @name end |
#owner_id ⇒ Integer? (readonly)
Returns the channel’s owner ID if this is a group channel.
84 85 86 |
# File 'lib/discordrb/events/channels.rb', line 84 def owner_id @owner_id end |
#position ⇒ Integer (readonly)
Returns the position of the channel on the list.
72 73 74 |
# File 'lib/discordrb/events/channels.rb', line 72 def position @position end |
#server ⇒ Server (readonly)
Returns the channel’s server.
81 82 83 |
# File 'lib/discordrb/events/channels.rb', line 81 def server @server end |
#topic ⇒ String (readonly)
Returns the channel’s topic.
69 70 71 |
# File 'lib/discordrb/events/channels.rb', line 69 def topic @topic end |
#type ⇒ Integer (readonly)
Returns the channel’s type (0: text, 1: private, 2: voice, 3: group).
66 67 68 |
# File 'lib/discordrb/events/channels.rb', line 66 def type @type end |