Class: Discorb::VoiceChannel
- Inherits:
-
GuildChannel
- Object
- DiscordModel
- Channel
- GuildChannel
- Discorb::VoiceChannel
- Includes:
- Connectable
- Defined in:
- lib/discorb/channel.rb
Overview
Represents a voice channel.
Instance Attribute Summary collapse
-
#bitrate -> Integer
readonly
The bitrate of the voice channel.
- #user_limit -> Integer? readonly
Attributes inherited from GuildChannel
#permission_overwrites, #position
Attributes inherited from Channel
Instance Method Summary collapse
-
#edit(name: :unset, position: :unset, bitrate: :unset, user_limit: :unset, rtc_region: :unset, reason: nil) -> Async::Task<self>
(also: #modify)
Edit the voice channel.
Methods included from Connectable
Methods inherited from GuildChannel
#<=>, #==, #delete!, #guild, #inspect, #mention, #move, #parent, #to_s
Methods inherited from Channel
Methods inherited from DiscordModel
Instance Attribute Details
#bitrate -> Integer (readonly)
Returns The bitrate of the voice channel.
600 601 602 |
# File 'lib/discorb/channel.rb', line 600 def bitrate @bitrate end |
#user_limit -> Integer? (readonly)
603 604 605 |
# File 'lib/discorb/channel.rb', line 603 def user_limit @user_limit end |
Instance Method Details
#edit(name: :unset, position: :unset, bitrate: :unset, user_limit: :unset, rtc_region: :unset, reason: nil) -> Async::Task<self> Also known as: modify
Note:
This is an asynchronous method, it will return a Async::Task
object. Use Async::Task#wait
to get the result.
Note:
This method calls HTTP request.
Note:
The arguments of this method are defaultly set to :unset
. Specify value to set the value, if not don't specify or specify :unset
.
Edit the voice channel.
623 624 625 626 627 628 629 630 631 632 633 634 635 |
# File 'lib/discorb/channel.rb', line 623 def edit(name: :unset, position: :unset, bitrate: :unset, user_limit: :unset, rtc_region: :unset, reason: nil) Async do payload = {} payload[:name] = name if name != :unset payload[:position] = position if position != :unset payload[:bitrate] = bitrate if bitrate != :unset payload[:user_limit] = user_limit if user_limit != :unset payload[:rtc_region] = rtc_region if rtc_region != :unset @client.http.patch("/channels/#{@id}", payload, audit_log_reason: reason).wait self end end |