Table of Contents

Class GuildChannelProperties

Namespace
Discord
Assembly
Discord.Net.Core.dll

Properties that are used to modify an IGuildChannel with the specified changes.

public class GuildChannelProperties
Inheritance
GuildChannelProperties
Derived
Inherited Members

Examples

The following example uses ModifyAsync to apply changes specified in the properties,

var channel = _client.GetChannel(id) as IGuildChannel;
if (channel == null) return;

await channel.ModifyAsync(x =>
{
    x.Name = "new-name";
    x.Position = channel.Position - 1;
});

Properties

CategoryId

Gets or sets the category ID for this channel.

public Optional<ulong?> CategoryId { get; set; }

Property Value

Optional<ulong?>

Remarks

Setting this value to a category's snowflake identifier will change or set this channel's parent to the specified channel; setting this value to null will detach this channel from its parent if one is set.

Flags

Gets or sets the flags of the channel.

public Optional<ChannelFlags> Flags { get; set; }

Property Value

Optional<ChannelFlags>

Name

Gets or sets the channel to this name.

public Optional<string> Name { get; set; }

Property Value

Optional<string>

Remarks

This property defines the new name for this channel.

warning

When modifying an ITextChannel, the Name must be alphanumeric with dashes. It must match the RegEx [a-z0-9-_]{2,100}.

PermissionOverwrites

Gets or sets the permission overwrites for this channel.

public Optional<IEnumerable<Overwrite>> PermissionOverwrites { get; set; }

Property Value

Optional<IEnumerable<Overwrite>>

Position

Moves the channel to the following position. This property is zero-based.

public Optional<int> Position { get; set; }

Property Value

Optional<int>

See Also