Search Results for

    Show / Hide Table of Contents

    Interface IGuildChannel

    Represents a generic guild channel.

    Inherited Members
    IChannel.Name
    ISnowflakeEntity.CreatedAt
    IEntity<UInt64>.Id
    IDeletable.DeleteAsync(RequestOptions)
    Namespace: Discord
    Assembly: Discord.Net.Core.dll
    Syntax
    public interface IGuildChannel : IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable

    Properties

    | Improve this Doc View Source

    Flags

    Gets the flags related to this channel.

    Declaration
    ChannelFlags Flags { get; }
    Property Value
    Type Description
    ChannelFlags

    A channel's flags, if any is associated.

    Remarks

    This value is determined by bitwise OR-ing ChannelFlags values together.

    | Improve this Doc View Source

    Guild

    Gets the guild associated with this channel.

    Declaration
    IGuild Guild { get; }
    Property Value
    Type Description
    IGuild

    A guild object that this channel belongs to.

    | Improve this Doc View Source

    GuildId

    Gets the guild ID associated with this channel.

    Declaration
    ulong GuildId { get; }
    Property Value
    Type Description
    UInt64

    An representing the guild snowflake identifier for the guild that this channel belongs to.

    | Improve this Doc View Source

    PermissionOverwrites

    Gets a collection of permission overwrites for this channel.

    Declaration
    IReadOnlyCollection<Overwrite> PermissionOverwrites { get; }
    Property Value
    Type Description
    IReadOnlyCollection<Overwrite>

    A collection of overwrites associated with this channel.

    | Improve this Doc View Source

    Position

    Gets the position of this channel.

    Declaration
    int Position { get; }
    Property Value
    Type Description
    Int32

    An representing the position of this channel in the guild's channel list relative to others of the same type.

    Methods

    | Improve this Doc View Source

    AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)

    Adds or updates the permission overwrite for the given role.

    Declaration
    Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null)
    Parameters
    Type Name Description
    IRole role

    The role to add the overwrite to.

    OverwritePermissions permissions

    The overwrite to add to the role.

    RequestOptions options

    The options to be used when sending the request.

    Returns
    Type Description
    Task

    A task representing the asynchronous permission operation for adding the specified permissions to the channel.

    Examples

    The following example fetches a role via GetRole(UInt64) and a channel via GetChannelAsync(UInt64, CacheMode, RequestOptions). Next, it checks if an overwrite had already been set via GetPermissionOverwrite(IRole); if not, it denies the role from sending any messages to the channel.

    | Improve this Doc View Source

    AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)

    Adds or updates the permission overwrite for the given user.

    Declaration
    Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null)
    Parameters
    Type Name Description
    IUser user

    The user to add the overwrite to.

    OverwritePermissions permissions

    The overwrite to add to the user.

    RequestOptions options

    The options to be used when sending the request.

    Returns
    Type Description
    Task

    A task representing the asynchronous permission operation for adding the specified permissions to the channel.

    Examples

    The following example fetches a user via GetUserAsync(UInt64, CacheMode, RequestOptions) and a channel via GetChannelAsync(UInt64, CacheMode, RequestOptions). Next, it checks if an overwrite had already been set via GetPermissionOverwrite(IUser); if not, it denies the user from sending any messages to the channel.

    | Improve this Doc View Source

    GetPermissionOverwrite(IRole)

    Gets the permission overwrite for a specific role.

    Declaration
    OverwritePermissions? GetPermissionOverwrite(IRole role)
    Parameters
    Type Name Description
    IRole role

    The role to get the overwrite from.

    Returns
    Type Description
    Nullable<OverwritePermissions>

    An overwrite object for the targeted role; null if none is set.

    | Improve this Doc View Source

    GetPermissionOverwrite(IUser)

    Gets the permission overwrite for a specific user.

    Declaration
    OverwritePermissions? GetPermissionOverwrite(IUser user)
    Parameters
    Type Name Description
    IUser user

    The user to get the overwrite from.

    Returns
    Type Description
    Nullable<OverwritePermissions>

    An overwrite object for the targeted user; null if none is set.

    | Improve this Doc View Source

    GetUserAsync(UInt64, CacheMode, RequestOptions)

    Gets a user in this channel.

    Declaration
    Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
    Parameters
    Type Name Description
    UInt64 id

    The snowflake identifier of the user.

    CacheMode mode

    The CacheMode that determines whether the object should be fetched from cache.

    RequestOptions options

    The options to be used when sending the request.

    Returns
    Type Description
    Task<IGuildUser>

    A task representing the asynchronous get operation. The task result contains a guild user object that represents the user; null if none is found.

    | Improve this Doc View Source

    GetUsersAsync(CacheMode, RequestOptions)

    Gets a collection of users that are able to view the channel or are currently in this channel.

    Declaration
    IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
    Parameters
    Type Name Description
    CacheMode mode

    The CacheMode that determines whether the object should be fetched from cache.

    RequestOptions options

    The options to be used when sending the request.

    Returns
    Type Description
    IAsyncEnumerable<IReadOnlyCollection<IGuildUser>>

    Paged collection of users.

    Remarks

    This method follows the same behavior as described in GetUsersAsync(CacheMode, RequestOptions). Please visit its documentation for more details on this method.

    | Improve this Doc View Source

    ModifyAsync(Action<GuildChannelProperties>, RequestOptions)

    Modifies this guild channel.

    Declaration
    Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null)
    Parameters
    Type Name Description
    Action<GuildChannelProperties> func

    The delegate containing the properties to modify the channel with.

    RequestOptions options

    The options to be used when sending the request.

    Returns
    Type Description
    Task

    A task that represents the asynchronous modification operation.

    Remarks

    This method modifies the current guild channel with the specified properties. To see an example of this method and what properties are available, please refer to GuildChannelProperties.

    | Improve this Doc View Source

    RemovePermissionOverwriteAsync(IRole, RequestOptions)

    Removes the permission overwrite for the given role, if one exists.

    Declaration
    Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
    Parameters
    Type Name Description
    IRole role

    The role to remove the overwrite from.

    RequestOptions options

    The options to be used when sending the request.

    Returns
    Type Description
    Task

    A task representing the asynchronous operation for removing the specified permissions from the channel.

    | Improve this Doc View Source

    RemovePermissionOverwriteAsync(IUser, RequestOptions)

    Removes the permission overwrite for the given user, if one exists.

    Declaration
    Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)
    Parameters
    Type Name Description
    IUser user

    The user to remove the overwrite from.

    RequestOptions options

    The options to be used when sending the request.

    Returns
    Type Description
    Task

    A task representing the asynchronous operation for removing the specified permissions from the channel.

    Extension Methods

    ChannelExtensions.GetChannelType(IChannel)

    See Also

    ITextChannel
    IVoiceChannel
    ICategoryChannel

    Theme

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