-
Notifications
You must be signed in to change notification settings - Fork 98
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
Support multiple embeds #194
Conversation
fd855b3
to
9f5a9ea
Compare
In this case, @message contains a Hash instead of a Message, preventing to call the .components method on it. So we instantiate a Message object if it is a Hash.
+ string_select (old select_menu) + user_select + role_select + mentionable_select + channel_select
Was used as a debugging tool to see why the Webhook#update test was failing in Ruby 3+
+ update_webhook(**data) will solve the problem in Ruby 3+ + The addition of "if data.key?(:channel)" fixes a bug also present in Ruby 2.7
Currently, it is impossible to access more than the first 1000 bans in the list because of these missing arguments. https://discord.com/developers/docs/resources/guild#get-guild-bans
…multiple embeds Issues shardlab#132
9f5a9ea
to
a3bec22
Compare
data.delete(:channel) | ||
update_webhook(data) | ||
update_webhook(**data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is data being spread here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had noticed that this is a problem that affects Ruby 3+.
Without this, the test suite concerning webhooks does not pass, at least without modifying the test directly
@@ -14,7 +14,7 @@ def self.from_data(data, bot) | |||
ActionRow.new(data, bot) | |||
when Webhooks::View::COMPONENT_TYPES[:button] | |||
Button.new(data, bot) | |||
when Webhooks::View::COMPONENT_TYPES[:select_menu] | |||
when Webhooks::View::COMPONENT_TYPES[:string_select] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we not supporting the other select types?
end | ||
|
||
# Event for when a user interacts with a select menu component. | ||
class SelectMenuEvent < ComponentEvent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be removed and should be the base for all other select events
end | ||
end | ||
|
||
# Event handler for a select menu component. | ||
class SelectMenuEventHandler < ComponentEventHandler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise this should be the base for other select menu event handlers
@@ -55,7 +55,7 @@ | |||
|
|||
describe '.delete_all_emoji_reactions' do | |||
let(:message_id) { double('message_id', to_s: 'message_id') } | |||
let(:emoji) { "\u{1F525}" } | |||
let(:emoji) { '\u{1F525}' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be double quotes
Closed in favor of #209 |
Summary
Fixes the problem preventing the creation and editing of messages with multiple embeds
(Based on PR #193)
Fixed
Fix #132