Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component data class does not support all components available in builder #225

Open
joelzwarrington opened this issue Jun 3, 2023 · 0 comments

Comments

@joelzwarrington
Copy link

Summary

I'm using the Components::View builder to provide additional inputs after a slash command.

bot.application_command(:example) do |event|
  message = event.respond(
    ephemeral: true,
    wait: true,
    components: Discordrb::Components::View.new do |builder|
      builder.row do |row|
        row.user_select(
          custom_id: SecureRandom.uuid,
          placeholder: 'users',
          min_values: 10,
          max_values: 10
        )
      end
    end
  )
end

Upon completion of the user select, the message has the component, but it's nil.

row = message.components
row.components.count
# => 1

row.components.first
# => nil

I have reason to believe it is because of #self.from_data which doesn't include all of the types available in the builder.

The component types which are missing:

  • user_select
  • role_select
  • mentionable_select
  • channel_select

Maybe I'm misunderstanding, but how should I get the value of these types of components?


Environment

Ruby version:

ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [arm64-darwin21]

Discordrb version:

Gemfile

gem 'discordrb', github: 'shardlab/discordrb', branch: 'main'

Gemfile.lock

GIT
  remote: https://github.com/shardlab/discordrb.git
  revision: 4551619ecdfacf438ad1dd18b55e1906effaf80a
  branch: main
  specs:
    discordrb (3.4.2)
      discordrb-webhooks (~> 3.4.2)
      ffi (>= 1.9.24)
      opus-ruby
      rest-client (>= 2.0.0)
      websocket-client-simple (>= 0.3.0)
    discordrb-webhooks (3.4.2)
      rest-client (>= 2.0.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant