Class: MijDiscord::Events::StartTyping
- Defined in:
- lib/mij-discord/events/message.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
(also: #author)
readonly
Returns the value of attribute user.
Attributes inherited from Generic
Instance Method Summary collapse
-
#initialize(bot, data) ⇒ StartTyping
constructor
A new instance of StartTyping.
Methods inherited from EventBase
delegate_method, filter_match, inherited, #trigger?
Constructor Details
#initialize(bot, data) ⇒ StartTyping
Returns a new instance of StartTyping.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/mij-discord/events/message.rb', line 91 def initialize(bot, data) super(bot) = Time.at(data['timestamp'].to_i).utc @channel = @bot.channel(data['channel_id']) @user = if @channel.pm? @channel.recipient elsif @channel.group? @bot.user(data['user_id']) else @bot.member(@channel.server, data['user_id']) end end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
70 71 72 |
# File 'lib/mij-discord/events/message.rb', line 70 def channel @channel end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
75 76 77 |
# File 'lib/mij-discord/events/message.rb', line 75 def end |
#user ⇒ Object (readonly) Also known as:
Returns the value of attribute user.
72 73 74 |
# File 'lib/mij-discord/events/message.rb', line 72 def user @user end |