Skip to content

Commit

Permalink
Support the creation of voice stage channels by accpting (13) as a va…
Browse files Browse the repository at this point in the history
…lid parameter for channel type.
  • Loading branch information
Droid00000 committed Aug 29, 2024
1 parent b506f60 commit 1207b2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/discordrb/data/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def update_voice_state(data)
# @raise [ArgumentError] if type is not 0 (text), 2 (voice), 4 (category), 5 (news), or 6 (store)
def create_channel(name, type = 0, topic: nil, bitrate: nil, user_limit: nil, permission_overwrites: nil, parent: nil, nsfw: false, rate_limit_per_user: nil, position: nil, reason: nil)
type = Channel::TYPES[type] if type.is_a?(Symbol)
raise ArgumentError, 'Channel type must be either 0 (text), 2 (voice), 4 (category), news (5), store (6), or forum (15)!' unless [0, 2, 4, 5, 6, 15].include?(type)
raise ArgumentError, 'Channel type must be either 0 (text), 2 (voice), 4 (category), news (5), store (6), voice stage (13), or forum (15)!' unless [0, 2, 4, 5, 6, 13, 15].include?(type)

permission_overwrites.map! { |e| e.is_a?(Overwrite) ? e.to_hash : e } if permission_overwrites.is_a?(Array)
parent_id = parent.respond_to?(:resolve_id) ? parent.resolve_id : nil
Expand Down

0 comments on commit 1207b2e

Please sign in to comment.