Closed swistak closed 6 months ago
I just tried to fix this myself but this seems to be fixed in master
See:
But unfortunately does not seem to have been released :(
If someone stumbles upon this, a workaround is to use dev version of the gem. Add following to Gemfile and bundle install:
gem 'discordrb', '~> 3.5', git: 'https://github.com/shardlab/discordrb', branch: 'main'
Summary
Example for buttons/select_menu https://github.com/shardlab/discordrb/blob/main/examples/slash_commands.rb#L72-L86 does nto work. When run results in error:
The problem lies in https://github.com/shardlab/discordrb/blob/main/lib/discordrb/webhooks/view.rb#L148 calling
to_h
onnil
which at least in ruby 3+ returns{}
which in turns causes discord API to reject the message.Environment
Ruby version:
ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]
Discordrb version: