Class: Discordrb::Events::TypingEvent
- Inherits:
-
Object
- Object
- Discordrb::Events::TypingEvent
- Defined in:
- lib/discordrb/events/typing.rb
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
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) = Time.at(data['timestamp'].to_i) end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
5 6 7 |
# File 'lib/discordrb/events/typing.rb', line 5 def channel @channel end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
5 6 7 |
# File 'lib/discordrb/events/typing.rb', line 5 def end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'lib/discordrb/events/typing.rb', line 5 def user @user end |