onyxcord 3.2.5 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58b6c40e04d80caf8907786964a17a7499074e7f2a213ba0c8d95aa4a7a97617
4
- data.tar.gz: f5a62bd27e38a81f849b0cdd8e4f3210e73f684775320929a7f01cd963d3b9fc
3
+ metadata.gz: a198cb1ead59b05936a681bdf1c83dbf7ffe3b68f223548508e8dde371f2951a
4
+ data.tar.gz: 1c81f3befc93b00e0c685e4d3506bbf52fc406bf729f060ad591dfde7818a59c
5
5
  SHA512:
6
- metadata.gz: d5fd3b0d1966b6e37b23675bc5ac1948b059cfe9b4777032b5d573c2bb199cf540776291b51c1e92a5e368021e5191d09089cccb18fd6f04e2438c193914b8ac
7
- data.tar.gz: 3ad8f80253da0da08e946870590bbf10b9ffd70da02fe24f838d67d0bce5d93f58302f03493b7e187fe00a76a36c53d63e4c6cec67e698bbbabba43cd4779a0a
6
+ metadata.gz: 6763d7f434e9dbe46a7838a86df33b5f61de198b200006d442af5b899935f76cfd1afc81ca1d3d80c25f6606f2018a946f4488d4bb3ec254449fe0f3620d90a0
7
+ data.tar.gz: 6e4352a1a1b1ba32a770ce2047de68c4b3f677e52ddf9984bd61d17e3d20c560d8f6ce716c8563e51aae0086b980d67a9a31d3830007d7b577dde8353a1d8716
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnyxCord
4
- VERSION = '3.2.5'
4
+ VERSION = '3.2.6'
5
5
  end
@@ -49,12 +49,6 @@ module OnyxCord
49
49
  class ActionRow
50
50
  include Enumerable
51
51
 
52
- DELEGATED_COMPONENT_METHODS = %i[
53
- custom_id
54
- value
55
- values
56
- ].freeze
57
-
58
52
  # @return [Integer] the numeric identifier of the action row.
59
53
  attr_reader :id
60
54
 
@@ -90,13 +84,6 @@ module OnyxCord
90
84
  def to_a
91
85
  @components
92
86
  end
93
-
94
- DELEGATED_COMPONENT_METHODS.each do |name|
95
- define_method(name) do
96
- component = @components.first
97
- component.public_send(name) if @components.one? && component.respond_to?(name)
98
- end
99
- end
100
87
  end
101
88
 
102
89
  # An interactable button component.
@@ -498,14 +485,6 @@ module OnyxCord
498
485
 
499
486
  # A parent component for interactive modal components.
500
487
  class Label
501
- # Methods from the wrapped interactive component that should remain
502
- # available for legacy modal code that iterates over event.components.
503
- DELEGATED_COMPONENT_METHODS = %i[
504
- custom_id
505
- value
506
- values
507
- ].freeze
508
-
509
488
  # @return [Integer] the numeric identifier of the label.
510
489
  attr_reader :id
511
490
 
@@ -526,12 +505,6 @@ module OnyxCord
526
505
  @description = data['description']
527
506
  @component = Components.from_data(data['component'], @bot)
528
507
  end
529
-
530
- DELEGATED_COMPONENT_METHODS.each do |name|
531
- define_method(name) do
532
- @component.public_send(name) if @component.respond_to?(name)
533
- end
534
- end
535
508
  end
536
509
 
537
510
  # A surface that allows users to upload files in a modal.
@@ -39,53 +39,9 @@ class OnyxCord::Webhooks::Modal
39
39
  @components << LabelBuilder.new(...)
40
40
  end
41
41
 
42
- # Add a legacy action row to the modal.
43
- def row(id: nil)
44
- @components << LegacyRowBuilder.new(id: id) { |row| yield row }
45
- end
46
-
47
42
  # Add a text display component to the view.
48
43
  # @see Webhooks::View::TextDisplayBuilder#initialize
49
44
  def text_display(...)
50
45
  @components << OnyxCord::Webhooks::View::TextDisplayBuilder.new(...)
51
46
  end
52
-
53
- class LegacyRowBuilder
54
- def initialize(id: nil)
55
- @id = id
56
- @components = []
57
-
58
- yield self if block_given?
59
- end
60
-
61
- def text_input(style:, custom_id:, id: nil, min_length: nil, max_length: nil, required: nil, value: nil, placeholder: nil, label: nil)
62
- @components << {
63
- type: COMPONENT_TYPES[:text_input],
64
- custom_id: custom_id,
65
- id: id,
66
- label: label,
67
- style: LabelBuilder::TEXT_INPUT_STYLES[style] || style,
68
- min_length: min_length,
69
- max_length: max_length,
70
- required: required,
71
- value: value,
72
- placeholder: placeholder
73
- }.compact
74
- end
75
-
76
- def file_upload(custom_id:, id: nil, min_values: nil, max_values: nil, required: nil)
77
- @components << {
78
- type: COMPONENT_TYPES[:file_upload],
79
- custom_id: custom_id,
80
- id: id,
81
- min_values: min_values,
82
- max_values: max_values,
83
- required: required
84
- }.compact
85
- end
86
-
87
- def to_h
88
- { type: COMPONENT_TYPES[:action_row], id: @id, components: @components }.compact
89
- end
90
- end
91
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onyxcord
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Silva