コード例 #1
0
ファイル: GuildChannel.cs プロジェクト: rissussss/Anarchy
        /// <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;
        }
コード例 #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;
        }
コード例 #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));
 }
コード例 #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));
 }
コード例 #5
0
ファイル: Extensions.cs プロジェクト: Mariobob/Anarchy
 public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties)
 {
     return(client.HttpClient.Patch($"/channels/{channelId}", properties).DeserializeEx <GuildChannel>().SetClient(client));
 }
コード例 #6
0
ファイル: GuildChannel.cs プロジェクト: skizap/Anarchy
 /// <summary>
 /// Modifies the channel
 /// </summary>
 /// <param name="properties">Options for modifying the channel</param>
 public void Modify(GuildChannelProperties properties)
 {
     ModifyAsync(properties).GetAwaiter().GetResult();
 }
コード例 #7
0
ファイル: GuildChannel.cs プロジェクト: skizap/Anarchy
 public async Task ModifyAsync(GuildChannelProperties properties)
 {
     Update(await Client.ModifyGuildChannelAsync(Id, properties));
 }
コード例 #8
0
 public static GuildChannel ModifyGuildChannel(this DiscordClient client, ulong channelId, GuildChannelProperties properties)
 {
     return(client.ModifyGuildChannelAsync(channelId, properties).GetAwaiter().GetResult());
 }
コード例 #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));
 }