module Discordrb::Components

Components are interactable interfaces that can be attached to messages.

Public Class Methods

from_data(data, bot) click to toggle source

@!visibility private

# File lib/discordrb/data/component.rb, line 11
def self.from_data(data, bot)
  case data['type']
  when Webhooks::View::COMPONENT_TYPES[:action_row]
    ActionRow.new(data, bot)
  when Webhooks::View::COMPONENT_TYPES[:button]
    Button.new(data, bot)
  when Webhooks::View::COMPONENT_TYPES[:string_select]
    SelectMenu.new(data, bot)
  when Webhooks::Modal::COMPONENT_TYPES[:text_input]
    TextInput.new(data, bot)
  end
end