Example #1
0
        public void Modify(VoiceChannelProperties properties)
        {
            if (!properties.NameProperty.Set)
            {
                properties.Name = Name;
            }
            if (!properties.PositionProperty.Set)
            {
                properties.Position = Position;
            }
            if (!properties.ParentProperty.Set)
            {
                properties.ParentId = ParentId;
            }
            if (!properties.BitrateProperty.Set)
            {
                properties.Bitrate = Bitrate;
            }
            if (!properties.UserLimitProperty.Set)
            {
                properties.UserLimit = UserLimit;
            }

            VoiceChannel channel = Client.ModifyVoiceChannel(Id, properties);

            Name                 = channel.Name;
            Position             = channel.Position;
            ParentId             = channel.ParentId;
            PermissionOverwrites = channel.PermissionOverwrites;
            Bitrate              = channel.Bitrate;
            UserLimit            = channel.UserLimit;
        }
Example #2
0
        /// <summary>
        /// Modifies the channel
        /// </summary>
        /// <param name="properties">Options for modifying the channel</param>
        public void Modify(VoiceChannelProperties properties)
        {
            VoiceChannel channel = Client.ModifyVoiceChannel(Id, properties);

            Name                 = channel.Name;
            Position             = channel.Position;
            ParentId             = channel.ParentId;
            PermissionOverwrites = channel.PermissionOverwrites;
            Bitrate              = channel.Bitrate;
            UserLimit            = channel.UserLimit;
        }
Example #3
0
 /// <summary>
 /// Modifies the channel
 /// </summary>
 /// <param name="properties">Options for modifying the channel</param>
 public void Modify(VoiceChannelProperties properties)
 {
     Update(Client.ModifyGuildChannel(Id, properties));
 }
Example #4
0
 /// <summary>
 /// Modifies a guild voice channel
 /// </summary>
 /// <param name="channelId">ID of the channel</param>
 /// <param name="properties">Options for modifying the channel</param>
 /// <returns>The modified <see cref="VoiceChannel"/></returns>
 public static VoiceChannel ModifyVoiceChannel(this DiscordClient client, ulong channelId, VoiceChannelProperties properties)
 {
     return(client.modifyChannel <VoiceChannel, VoiceChannelProperties>(channelId, properties));
 }
Example #5
0
 /// <summary>
 /// Modifies the channel
 /// </summary>
 /// <param name="properties">Options for modifying the channel</param>
 public void Modify(VoiceChannelProperties properties)
 {
     ModifyAsync(properties).GetAwaiter().GetResult();
 }
Example #6
0
 public async Task ModifyAsync(VoiceChannelProperties properties)
 {
     Update(await Client.ModifyGuildChannelAsync(Id, properties));
 }