Class: Discorb::GatewayHandler::MessagePinEvent
- Inherits:
-
GatewayEvent
- Object
- GatewayEvent
- Discorb::GatewayHandler::MessagePinEvent
- Defined in:
- lib/discorb/gateway.rb
Overview
Represents a message pin event.
Instance Attribute Summary collapse
-
#message -> Discorb::Message
readonly
The message that was pinned.
-
#pinned? -> Boolean
readonly
Whether the message was pinned.
-
#type -> :pinned, :unpinned
readonly
The type of event.
-
#unpinned? -> Boolean
readonly
Whether the message was unpinned.
Instance Method Summary collapse
-
#initialize(client, data, message) -> MessagePinEvent
constructor
A new instance of MessagePinEvent.
Constructor Details
#initialize(client, data, message) -> MessagePinEvent
Returns a new instance of MessagePinEvent.
404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/discorb/gateway.rb', line 404 def initialize(client, data, ) @client = client @data = data @message = @type = if .nil? :unknown elsif @message.pinned? :pinned else :unpinned end end |
Instance Attribute Details
#message -> Discorb::Message (readonly)
Returns The message that was pinned.
395 396 397 |
# File 'lib/discorb/gateway.rb', line 395 def @message end |
#pinned? -> Boolean (readonly)
Returns Whether the message was pinned.
404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/discorb/gateway.rb', line 404 def initialize(client, data, ) @client = client @data = data @message = @type = if .nil? :unknown elsif @message.pinned? :pinned else :unpinned end end |
#type -> :pinned, :unpinned (readonly)
Returns The type of event.
397 398 399 |
# File 'lib/discorb/gateway.rb', line 397 def type @type end |
#unpinned? -> Boolean (readonly)
Returns Whether the message was unpinned.
404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/discorb/gateway.rb', line 404 def initialize(client, data, ) @client = client @data = data @message = @type = if .nil? :unknown elsif @message.pinned? :pinned else :unpinned end end |