Search Results for

    Show / Hide Table of Contents

    Class DiscordOverwrite

    Represents a permission overwrite for a channel.

    Inheritance
    System.Object
    SnowflakeObject
    DiscordOverwrite
    Inherited Members
    SnowflakeObject.Id
    SnowflakeObject.CreationTimestamp
    Namespace: DisCatSharp.Entities
    Assembly: DisCatSharp.dll
    Syntax
    public class DiscordOverwrite : SnowflakeObject

    Properties

    | Improve this Doc View Source

    Allowed

    Gets the allowed permission set.

    Declaration
    public Permissions Allowed { get; }
    Property Value
    Type Description
    Permissions
    | Improve this Doc View Source

    Denied

    Gets the denied permission set.

    Declaration
    public Permissions Denied { get; }
    Property Value
    Type Description
    Permissions
    | Improve this Doc View Source

    Type

    Gets the type of the overwrite. Either "role" or "member".

    Declaration
    public OverwriteType Type { get; }
    Property Value
    Type Description
    OverwriteType

    Methods

    | Improve this Doc View Source

    CheckPermission(Permissions)

    Checks whether given permissions are allowed, denied, or not set.

    Declaration
    public PermissionLevel CheckPermission(Permissions permission)
    Parameters
    Type Name Description
    Permissions permission

    Permissions to check.

    Returns
    Type Description
    PermissionLevel

    Whether given permissions are allowed, denied, or not set.

    | Improve this Doc View Source

    DeleteAsync(String)

    Deletes this channel overwrite.

    Declaration
    public Task DeleteAsync(string reason = null)
    Parameters
    Type Name Description
    System.String reason

    Reason as to why this overwrite gets deleted.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the ManageRoles permission.

    NotFoundException

    Thrown when the overwrite does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Discord is unable to process the request.

    | Improve this Doc View Source

    GetMemberAsync()

    Gets the DiscordMember that is affected by this overwrite.

    Declaration
    public async Task<DiscordMember> GetMemberAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<DiscordMember>

    The DiscordMember that is affected by this overwrite

    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the AccessChannels permission.

    NotFoundException

    Thrown when the overwrite does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Discord is unable to process the request.

    | Improve this Doc View Source

    GetRoleAsync()

    Gets the DiscordRole that is affected by this overwrite.

    Declaration
    public async Task<DiscordRole> GetRoleAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<DiscordRole>

    The DiscordRole that is affected by this overwrite

    Exceptions
    Type Condition
    NotFoundException

    Thrown when the role does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Discord is unable to process the request.

    | Improve this Doc View Source

    UpdateAsync(Nullable<Permissions>, Nullable<Permissions>, String)

    Updates this channel overwrite.

    Declaration
    public Task UpdateAsync(Permissions? allow = null, Permissions? deny = null, string reason = null)
    Parameters
    Type Name Description
    System.Nullable<Permissions> allow

    Permissions that are allowed.

    System.Nullable<Permissions> deny

    Permissions that are denied.

    System.String reason

    Reason as to why you made this change.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Exceptions
    Type Condition
    UnauthorizedException

    Thrown when the client does not have the ManageRoles permission.

    NotFoundException

    Thrown when the overwrite does not exist.

    BadRequestException

    Thrown when an invalid parameter was provided.

    ServerErrorException

    Thrown when Discord is unable to process the request.

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems