public async Task ModifyAsync(TextChannelProperties properties) { Update(await Client.ModifyGuildChannelAsync(Id, properties)); if (properties.TypeProperty.Set) { Type = properties.TypeProperty; } }
/// <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; }
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; }
/// <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)); }
/// <summary> /// Modifies the channel /// </summary> /// <param name="properties">Options for modifying the channel</param> public void Modify(TextChannelProperties properties) { ModifyAsync(properties).GetAwaiter().GetResult(); }
/// <summary> /// Modifies the channel /// </summary> /// <param name="properties">Options for modifying the channel</param> public void Modify(TextChannelProperties properties) { Update(Client.ModifyTextChannel(Id, properties)); }