/// <summary> /// Modifies the channel /// </summary> /// <param name="properties">Options for modifying the channel</param> public void Modify(GuildChannelProperties properties) { GuildChannel channel = Client.ModifyGuildChannel(Id, properties); Name = channel.Name; Position = channel.Position; ParentId = channel.ParentId; PermissionOverwrites = channel.PermissionOverwrites; }
public void Modify(GuildChannelProperties properties) { if (!properties.NameProperty.Set) { properties.Name = Name; } if (!properties.PositionProperty.Set) { properties.Position = Position; } if (!properties.ParentProperty.Set) { properties.ParentId = ParentId; } GuildChannel channel = Client.ModifyGuildChannel(Id, properties); Name = channel.Name; Position = channel.Position; ParentId = channel.ParentId; PermissionOverwrites = channel.PermissionOverwrites; }
/// <summary> /// Modifies a guild channel /// </summary> /// <param name="channelId">ID of the channel</param> /// <param name="properties">Options for modifying the guild channel</param> /// <returns>The modified <see cref="GuildChannel"/></returns> public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties) { return(client.modifyChannel <GuildChannel, GuildChannelProperties>(channelId, properties)); }
/// <summary> /// Modifies the channel /// </summary> /// <param name="properties">Options for modifying the channel</param> public void Modify(GuildChannelProperties properties) { Update(Client.ModifyGuildChannel(Id, properties)); }
public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties) { return(client.HttpClient.Patch($"/channels/{channelId}", properties).DeserializeEx <GuildChannel>().SetClient(client)); }
/// <summary> /// Modifies the channel /// </summary> /// <param name="properties">Options for modifying the channel</param> public void Modify(GuildChannelProperties properties) { ModifyAsync(properties).GetAwaiter().GetResult(); }
public async Task ModifyAsync(GuildChannelProperties properties) { Update(await Client.ModifyGuildChannelAsync(Id, properties)); }
public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties) { return(client.ModifyGuildChannelAsync(channelId, properties).GetAwaiter().GetResult()); }
public static async Task <GuildChannel> ModifyGuildChannelAsync(this DiscordClient client, ulong channelId, GuildChannelProperties properties) { return((await client.HttpClient.PatchAsync($"/channels/{channelId}", properties)) .ParseDeterministic <GuildChannel>().SetClient(client)); }