class Discorb::Gateway::MessagePinEvent

Represents a message pin event.

Attributes

message[R]

@return [Discorb::Message] The message that was pinned.

type[R]

@return [:pinned, :unpinned] The type of event.

Public Class Methods

new(client, data, message) click to toggle source

@!attribute [r] pinned?

@return [Boolean] Whether the message was pinned.

@!attribute [r] unpinned?

@return [Boolean] Whether the message was unpinned.
# File lib/discorb/gateway.rb, line 407
def initialize(client, data, message)
  @client = client
  @data = data
  @message = message
  @type = if message.nil?
      :unknown
    elsif @message.pinned?
      :pinned
    else
      :unpinned
    end
end

Public Instance Methods

pinned?() click to toggle source
# File lib/discorb/gateway.rb, line 420
def pinned?
  @type == :pinned
end
unpinned?() click to toggle source
# File lib/discorb/gateway.rb, line 424
def unpinned?
  @type = :unpinned
end