Class: DiscordRDA::TypingStartEvent
- Inherits:
-
Event
- Object
- Event
- DiscordRDA::TypingStartEvent
show all
- Defined in:
- lib/discord_rda/event/base.rb
Instance Attribute Summary
Attributes inherited from Event
#data, #shard_id, #timestamp, #type
Instance Method Summary
collapse
Methods inherited from Event
#created_at, #inspect, #to_h
Constructor Details
Returns a new instance of TypingStartEvent.
1033
1034
1035
|
# File 'lib/discord_rda/event/base.rb', line 1033
def initialize(data, shard_id:)
super('TYPING_START', data, shard_id: shard_id)
end
|
Instance Method Details
#channel_id ⇒ Object
1037
1038
1039
|
# File 'lib/discord_rda/event/base.rb', line 1037
def channel_id
@data['channel_id'] ? Snowflake.new(@data['channel_id']) : nil
end
|
#guild? ⇒ Boolean
1059
1060
1061
|
# File 'lib/discord_rda/event/base.rb', line 1059
def guild?
!guild_id.nil?
end
|
#guild_id ⇒ Object
1041
1042
1043
|
# File 'lib/discord_rda/event/base.rb', line 1041
def guild_id
@data['guild_id'] ? Snowflake.new(@data['guild_id']) : nil
end
|
#member ⇒ Object
1049
1050
1051
1052
1053
|
# File 'lib/discord_rda/event/base.rb', line 1049
def member
return nil unless @data['member']
Member.new(@data['member'].merge('guild_id' => @data['guild_id']))
end
|
#started_at ⇒ Object
1055
1056
1057
|
# File 'lib/discord_rda/event/base.rb', line 1055
def started_at
Time.at(@data['timestamp'].to_i).utc if @data['timestamp']
end
|
#user_id ⇒ Object
1045
1046
1047
|
# File 'lib/discord_rda/event/base.rb', line 1045
def user_id
@data['user_id'] ? Snowflake.new(@data['user_id']) : nil
end
|