Class: Discordrb::Events::ThreadCreateEvent

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

Overview

Raised when a thread is created

Direct Known Subclasses

ThreadUpdateEvent

Instance Attribute Summary collapse

Attributes inherited from Event

#bot

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ ThreadCreateEvent

Returns a new instance of ThreadCreateEvent.



11
12
13
14
# File 'lib/discordrb/events/threads.rb', line 11

def initialize(data, bot)
  @bot = bot
  @thread = data.is_a?(Discordrb::Channel) ? data : bot.channel(data['id'].to_i)
end

Instance Attribute Details

#threadChannel (readonly)

Returns the thread in question.

Returns:

  • (Channel)

    the thread in question.



7
8
9
# File 'lib/discordrb/events/threads.rb', line 7

def thread
  @thread
end