internal override Channel Clone() { var result = new VoiceChannel(Id, Server); _cloner(this, result); return(result); }
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; }
/// <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; }
/// <summary> /// Updates the channel's info /// </summary> public override void Update() { VoiceChannel channel = Client.GetVoiceChannel(Id); Name = channel.Name; Bitrate = channel.Bitrate; UserLimit = channel.UserLimit; Position = channel.Position; ParentId = channel.ParentId; PermissionOverwrites = channel.PermissionOverwrites; }
internal PublicChannel AddChannel(APIChannel model, bool cachePerms) { PublicChannel channel; ChannelType type = EnumConverters.ToChannelType(model.Type); if (type == ChannelType.Voice) { channel = new VoiceChannel(model, this); } else { channel = new TextChannel(model, this); } if (cachePerms && Client.Config.UsePermissionsCache) { foreach (var user in Users) { channel.AddUser(user); } } Client.AddChannel(channel); return(_channels.GetOrAdd(model.Id, x => channel)); }
protected void Update(VoiceChannel channel) { base.Update(channel); Bitrate = channel.Bitrate; UserLimit = channel.UserLimit; }