Esempio n. 1
0
        internal override Channel Clone()
        {
            var result = new VoiceChannel(Id, Server);

            _cloner(this, result);
            return(result);
        }
Esempio n. 2
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;
        }
Esempio n. 3
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;
        }
Esempio n. 4
0
        /// <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;
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
 protected void Update(VoiceChannel channel)
 {
     base.Update(channel);
     Bitrate   = channel.Bitrate;
     UserLimit = channel.UserLimit;
 }