Class: Discordrb::Events::TypingEvent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ TypingEvent



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

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.



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

def channel
  @channel
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

#userObject (readonly)

Returns the value of attribute user.



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

def user
  @user
end