Table of Contents

Class TextChannelProperties

Namespace
Discord
Assembly
Discord.Net.Core.dll

Provides properties that are used to modify an ITextChannel with the specified changes.

public class TextChannelProperties : GuildChannelProperties
Inheritance
TextChannelProperties
Derived
Inherited Members

Examples

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

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

await channel.ModifyAsync(x =>
{
    x.Name = "cool-guys-only";
    x.Topic = "This channel is only for cool guys and adults!!!";
    x.Position = channel.Position - 1;
    x.IsNsfw = true;
});

Properties

AutoArchiveDuration

Gets or sets the auto archive duration.

public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; }

Property Value

Optional<ThreadArchiveDuration>

ChannelType

Gets or sets the type of the channel. Only applicable for Text or News channels.

public Optional<ChannelType> ChannelType { get; set; }

Property Value

Optional<ChannelType>

DefaultSlowModeInterval

Gets or sets the default slow-mode for threads in this channel.

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

Property Value

Optional<int>

Remarks

Setting this value to anything above zero will require each user to wait X seconds before sending another message; setting this value to 0 will disable slow-mode for child threads.

note

Users with ManageMessages or ManageChannels will be exempt from slow-mode.

Exceptions

ArgumentOutOfRangeException

Thrown if the value does not fall within [0, 21600].

IsNsfw

Gets or sets whether this channel should be flagged as NSFW.

public Optional<bool> IsNsfw { get; set; }

Property Value

Optional<bool>

Remarks

Setting this value to true will mark the channel as NSFW (Not Safe For Work) and will prompt the user about its possibly mature nature before they may view the channel; setting this value to false will remove the NSFW indicator.

SlowModeInterval

Gets or sets the slow-mode ratelimit in seconds for this channel.

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

Property Value

Optional<int>

Remarks

Setting this value to anything above zero will require each user to wait X seconds before sending another message; setting this value to 0 will disable slow-mode for this channel.

note

Users with ManageMessages or ManageChannels will be exempt from slow-mode.

Exceptions

ArgumentOutOfRangeException

Thrown if the value does not fall within [0, 21600].

Topic

Gets or sets the topic of the channel.

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

Property Value

Optional<string>

Remarks

Setting this value to any string other than null or Empty will set the channel topic or description to the desired value.

See Also