Ejemplo n.º 1
0
        public async Task ModifyAsync(TextChannelProperties properties)
        {
            Update(await Client.ModifyGuildChannelAsync(Id, properties));

            if (properties.TypeProperty.Set)
            {
                Type = properties.TypeProperty;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Modifies the channel
        /// </summary>
        /// <param name="properties">Options for modifying the channel</param>
        public void Modify(TextChannelProperties properties)
        {
            TextChannel channel = Client.ModifyTextChannel(Id, properties);

            Name                 = channel.Name;
            Topic                = channel.Topic;
            Nsfw                 = channel.Nsfw;
            SlowMode             = channel.SlowMode;
            Position             = channel.Position;
            ParentId             = channel.ParentId;
            PermissionOverwrites = channel.PermissionOverwrites;
        }
Ejemplo n.º 3
0
        public void Modify(TextChannelProperties properties)
        {
            if (!properties.NameProperty.Set)
            {
                properties.Name = Name;
            }
            if (!properties.TopicProperty.Set)
            {
                properties.Topic = Topic;
            }
            if (!properties.NsfwProperty.Set)
            {
                properties.Nsfw = Nsfw;
            }
            if (!properties.SlowModeProperty.Set)
            {
                properties.SlowMode = SlowMode;
            }
            if (!properties.PositionProperty.Set)
            {
                properties.Position = Position;
            }
            if (!properties.ParentProperty.Set)
            {
                properties.ParentId = ParentId;
            }

            TextChannel channel = Client.ModifyTextChannel(Id, properties);

            Name                 = channel.Name;
            Topic                = channel.Topic;
            Nsfw                 = channel.Nsfw;
            SlowMode             = channel.SlowMode;
            Position             = channel.Position;
            ParentId             = channel.ParentId;
            PermissionOverwrites = channel.PermissionOverwrites;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Modifies a guild text channel
 /// </summary>
 /// <param name="channelId">ID of the channel</param>
 /// <param name="properties">Options for modifying the channel</param>
 /// <returns>The modified <see cref="TextChannel"/></returns>
 public static TextChannel ModifyTextChannel(this DiscordClient client, ulong channelId, TextChannelProperties properties)
 {
     return(client.modifyChannel <TextChannel, TextChannelProperties>(channelId, properties));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Modifies the channel
 /// </summary>
 /// <param name="properties">Options for modifying the channel</param>
 public void Modify(TextChannelProperties properties)
 {
     ModifyAsync(properties).GetAwaiter().GetResult();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Modifies the channel
 /// </summary>
 /// <param name="properties">Options for modifying the channel</param>
 public void Modify(TextChannelProperties properties)
 {
     Update(Client.ModifyTextChannel(Id, properties));
 }