Class: Discordrb::Events::TypingEvent
- Inherits:
-
Object
- Object
- Discordrb::Events::TypingEvent
- Defined in:
- lib/discordrb/events/typing.rb
Overview
Event raised when a user starts typing
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ TypingEvent
constructor
A new instance of TypingEvent.
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
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
6 7 8 |
# File 'lib/discordrb/events/typing.rb', line 6 def channel @channel end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
6 7 8 |
# File 'lib/discordrb/events/typing.rb', line 6 def @timestamp end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/discordrb/events/typing.rb', line 6 def user @user end |