Class: Discorb::Gateway::MessagePinEvent
- Inherits:
-
GatewayEvent
- Object
- GatewayEvent
- Discorb::Gateway::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.
Methods inherited from GatewayEvent
Constructor Details
#initialize(client, data, message) ⇒ MessagePinEvent
Returns a new instance of MessagePinEvent.
521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/discorb/gateway.rb', line 521 def initialize(client, data, ) @client = client @data = data = @type = if .nil? :unknown elsif .pinned? :pinned else :unpinned end end |
Instance Attribute Details
#message ⇒ Discorb::Message (readonly)
Returns The message that was pinned.
512 513 514 |
# File 'lib/discorb/gateway.rb', line 512 def end |
#pinned? ⇒ Boolean (readonly)
Returns Whether the message was pinned.
521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/discorb/gateway.rb', line 521 def initialize(client, data, ) @client = client @data = data = @type = if .nil? :unknown elsif .pinned? :pinned else :unpinned end end |
#type ⇒ :pinned, :unpinned (readonly)
Returns The type of event.
514 515 516 |
# File 'lib/discorb/gateway.rb', line 514 def type @type end |
#unpinned? ⇒ Boolean (readonly)
Returns Whether the message was unpinned.
521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/discorb/gateway.rb', line 521 def initialize(client, data, ) @client = client @data = data = @type = if .nil? :unknown elsif .pinned? :pinned else :unpinned end end |