Module: Rubord

Defined in:
lib/rubord/components/modal.rb,
lib/rubord.rb,
lib/rubord/models/role.rb,
lib/rubord/models/user.rb,
lib/rubord/models/embed.rb,
lib/rubord/models/emoji.rb,
lib/rubord/models/flags.rb,
lib/rubord/models/guild.rb,
lib/rubord/structs/rest.rb,
lib/rubord/models/member.rb,
lib/rubord/models/channel.rb,
lib/rubord/models/mention.rb,
lib/rubord/models/message.rb,
lib/rubord/structs/client.rb,
lib/rubord/structs/logger.rb,
lib/rubord/structs/models.rb,
lib/rubord/structs/parser.rb,
lib/rubord/structs/gateway.rb,
lib/rubord/components/button.rb,
lib/rubord/models/collection.rb,
lib/rubord/models/application.rb,
lib/rubord/models/interaction.rb,
lib/rubord/components/actionRow.rb,
lib/rubord/models/commands/base.rb,
lib/rubord/structs/rate_limiter.rb,
lib/rubord/components/select_menu.rb,
lib/rubord/models/commands/loader.rb,
lib/rubord/models/commands/registry.rb,
lib/rubord/components/containers/base.rb,
lib/rubord/components/containers/text.rb,
lib/rubord/components/containers/section.rb,
lib/rubord/components/containers/container.rb,
lib/rubord/components/containers/separator.rb

Overview

loader.rb

Defined Under Namespace

Modules: Components, Intents, Logger, MessageFlags, Permissions Classes: APIError, ActionRow, Application, BadRequestError, Button, Channel, Client, Collection, CommandBase, CommandLoader, CommandRegistry, Embed, Emoji, ForbiddenError, Gateway, GatewayError, Guild, Interaction, InvalidTokenError, Member, Mention, Message, Modal, NotFoundError, Parser, REST, RateLimitError, RateLimiter, Role, SelectMenu, ServerError, UnauthorizedError, User

Constant Summary collapse

VERSION =
"0.1.4"

Class Method Summary collapse

Class Method Details

.ActionRow(*args) ⇒ Rubord::ActionRow

Factory method for creating ActionRow instances.

Examples:

row = Rubord.ActionRow(button1, button2)

Parameters:

Returns:



90
91
92
# File 'lib/rubord/components/actionRow.rb', line 90

def self.ActionRow(*args)
  ActionRow.new(*args)
end

.Button(label: nil, style: 1, custom_id: nil, url: nil, disabled: false, emoji: nil) ⇒ Rubord::Button

Factory method for creating Button instances.

Examples:

button = Rubord.Button(label: "Click", custom_id: "click")

Parameters:

  • args (Hash)

    Button initialization parameters.

Returns:



122
123
124
125
126
127
128
129
130
131
# File 'lib/rubord/components/button.rb', line 122

def self.Button(label: nil, style: 1, custom_id: nil, url: nil, disabled: false, emoji: nil)
  Button.new(
    label: label,
    style: style,
    custom_id: custom_id,
    url: url,
    disabled: disabled,
    emoji: emoji
  )
end

.Container(*components, **opts) ⇒ Object



36
37
38
# File 'lib/rubord/components/containers/container.rb', line 36

def self.Container(*components, **opts)
  Components::Container.new(*components, **opts)
end

.EmbedObject



84
85
86
# File 'lib/rubord/models/embed.rb', line 84

def self.Embed
  Embed.new
end

Factory method for creating Modal instances.

Examples:

modal = Rubord.Modal(custom_id: "form", title: "Feedback Form")

Parameters:

  • args (Hash)

    Modal initialization parameters.

Returns:



131
132
133
# File 'lib/rubord/components/modal.rb', line 131

def self.Modal(**args)
  Modal.new(**args)
end

.ParserObject



65
66
67
# File 'lib/rubord/structs/parser.rb', line 65

def self.Parser
  @parser ||= Parser.new
end

.Section(**args) ⇒ Object



23
24
25
# File 'lib/rubord/components/containers/section.rb', line 23

def self.Section(**args)
  Components::Section.new(**args)
end

.SelectMenu(**args) ⇒ Rubord::SelectMenu

Factory method for creating SelectMenu instances.

Examples:

menu = Rubord.SelectMenu(custom_id: "choices", placeholder: "Make a choice")

Parameters:

  • args (SelectMenu)

    Select menu initialization parameters.

Returns:



144
145
146
# File 'lib/rubord/components/select_menu.rb', line 144

def self.SelectMenu(**args)
  SelectMenu.new(**args)
end

.Separator(**opts) ⇒ Object



48
49
50
# File 'lib/rubord/components/containers/separator.rb', line 48

def self.Separator(**opts)
  Components::Separator.new(**opts)
end

.Text(*content) ⇒ Object



20
21
22
# File 'lib/rubord/components/containers/text.rb', line 20

def self.Text(*content)
  Components::Text.new(content)
end