Exemple #1
0
        /// <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;
        }
Exemple #2
0
        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;
        }
Exemple #3
0
 /// <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));
 }
Exemple #4
0
 /// <summary>
 /// Modifies the channel
 /// </summary>
 /// <param name="properties">Options for modifying the channel</param>
 public void Modify(GuildChannelProperties properties)
 {
     Update(Client.ModifyGuildChannel(Id, properties));
 }
Exemple #5
0
 public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties)
 {
     return(client.HttpClient.Patch($"/channels/{channelId}", properties).DeserializeEx <GuildChannel>().SetClient(client));
 }
Exemple #6
0
 /// <summary>
 /// Modifies the channel
 /// </summary>
 /// <param name="properties">Options for modifying the channel</param>
 public void Modify(GuildChannelProperties properties)
 {
     ModifyAsync(properties).GetAwaiter().GetResult();
 }
Exemple #7
0
 public async Task ModifyAsync(GuildChannelProperties properties)
 {
     Update(await Client.ModifyGuildChannelAsync(Id, properties));
 }
Exemple #8
0
 public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties)
 {
     return(client.ModifyGuildChannelAsync(channelId, properties).GetAwaiter().GetResult());
 }
Exemple #9
0
 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));
 }