You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The expression new_data[:permission_overwrites].map { |_, v| v.to_hash } is present here, which I infer assumes new_data[:permission_overwrites] is a Hash (or something else that can be destructured into pairs). However, this makes no sense semantically, since the relevant Discord API endpoint (PATCH /channels/{channel.id}) takes an array of permission overwrite objects.
Summary
Here's the documentation for
Channel#permission_overwrites=
(as rendered by YARD):When I try to call the method as documented (
channel.permission_overwrites = [ow1, ow2]
), I get a stack trace like the following:This is because the implementation of this method doesn't match the docs. Here's the code for that method:
discordrb/lib/discordrb/data/channel.rb
Lines 345 to 347 in a873d4e
Here's the code for the method it calls:
discordrb/lib/discordrb/data/channel.rb
Lines 965 to 980 in a873d4e
The expression
new_data[:permission_overwrites].map { |_, v| v.to_hash }
is present here, which I infer assumesnew_data[:permission_overwrites]
is aHash
(or something else that can be destructured into pairs). However, this makes no sense semantically, since the relevant Discord API endpoint (PATCH/channels/{channel.id}
) takes an array of permission overwrite objects.Environment
Ruby version:
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [aarch64-linux]
Discordrb version:
discordrb (3.4.2 faace0f)
The text was updated successfully, but these errors were encountered: