Class: Rubycord::Events::ThreadCreateEvent

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



9
10
11
12
# File 'lib/rubycord/events/threads.rb', line 9

def initialize(data, bot)
  @bot = bot
  @thread = data.is_a?(Rubycord::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.



5
6
7
# File 'lib/rubycord/events/threads.rb', line 5

def thread
  @thread
end