Class: Discordrb::Events::TypingEvent

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

Overview

Event raised when a user starts typing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ TypingEvent

Returns a new instance of TypingEvent.



8
9
10
11
12
13
14
# File 'lib/discordrb/events/typing.rb', line 8

def initialize(data, bot)
  @user_id = data['user_id']
  @user = bot.user(@user_id)
  @channel_id = data['channel_id']
  @channel = bot.channel(@channel_id)
  @timestamp = Time.at(data['timestamp'].to_i)
end

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



6
7
8
# File 'lib/discordrb/events/typing.rb', line 6

def channel
  @channel
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



6
7
8
# File 'lib/discordrb/events/typing.rb', line 6

def timestamp
  @timestamp
end

#userObject (readonly)

Returns the value of attribute user.



6
7
8
# File 'lib/discordrb/events/typing.rb', line 6

def user
  @user
end