Class TextChannelProperties
Provides properties that are used to modify an ITextChannel with the specified changes.
Inheritance
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public class TextChannelProperties : GuildChannelProperties
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
| Improve this Doc View SourceAutoArchiveDuration
Gets or sets the auto archive duration.
Declaration
public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; }
Property Value
Type | Description |
---|---|
Optional<ThreadArchiveDuration> |
DefaultSlowModeInterval
Gets or sets the default slow-mode for threads in this channel.
Declaration
public Optional<int> DefaultSlowModeInterval { get; set; }
Property Value
Type | Description |
---|---|
Optional<Int32> |
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.
IsNsfw
Gets or sets whether this channel should be flagged as NSFW.
Declaration
public Optional<bool> IsNsfw { get; set; }
Property Value
Type | Description |
---|---|
Optional<Boolean> |
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.
Declaration
public Optional<int> SlowModeInterval { get; set; }
Property Value
Type | Description |
---|---|
Optional<Int32> |
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.
Topic
Gets or sets the topic of the channel.
Declaration
public Optional<string> Topic { get; set; }
Property Value
Type | Description |
---|---|
Optional<String> |
Remarks
Setting this value to any string other than null or