Search Results for

    Show / Hide Table of Contents

    Class TextChannelProperties

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

    Inheritance
    Object
    GuildChannelProperties
    TextChannelProperties
    ForumChannelProperties
    ThreadChannelProperties
    Inherited Members
    GuildChannelProperties.Name
    GuildChannelProperties.Position
    GuildChannelProperties.CategoryId
    GuildChannelProperties.PermissionOverwrites
    GuildChannelProperties.Flags
    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 Source

    AutoArchiveDuration

    Gets or sets the auto archive duration.

    Declaration
    public Optional<ThreadArchiveDuration> AutoArchiveDuration { get; set; }
    Property Value
    Type Description
    Optional<ThreadArchiveDuration>
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 will set the channel topic or description to the desired value.

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2022 3.9.0