Sha256: c1c20f75139ceb8c3a03d99d2b79490a2534449b1be1eee417ca2a6d5afce944

Contents?: true

Size: 799 Bytes

Versions: 2

Compression:

Stored size: 799 Bytes

Contents

module Discorb
  #
  # @abstract
  # Represents a Discord component.
  class Component
    def inspect: -> String

    #
    # Create a new component from hash data.
    #
    # @see https://discord.com/developers/docs/interactions/message-components Official Discord API documentation
    # @param [Hash] data Hash data.
    #
    # @return [Component] A new component.
    def self.from_hash: (Discorb::json data) -> Component

    #
    # Convert components to a hash.
    #
    # @param [Array<Discorb::Component>, Array<Array<Discorb::Component>>] components Components.
    #
    # @return [Array<Hash>] Hash data.
    def self.to_payload: (
      ::Array[Discorb::Component]
      | ::Array[::Array[Discorb::Component]] components
    ) -> Discorb::json
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discorb-0.18.1 sig/discorb/component/base.rbs
discorb-0.18.0 sig/discorb/component/base.rbs