PermissionOverwrite - truemedian/Discordia GitHub Wiki

Inherits Snowflake

Represents an object that is used to allow or deny specific permissions for a role or member in a Discord guild channel.

Methods

delete
getObject
getAllowedPermissions
getDeniedPermissions
setPermissions
setAllowedPermissions
setDeniedPermissions
allowPermissions
denyPermissions
clearPermissions
allowAllPermissions
denyAllPermissions
clearAllPermissions

Properties

type
channel
guild
allowedPermissions
deniedPermissions

Inherited from Container
client
parent

Inherited from Snowflake
id
createdAt
timestamp

Methods

:delete( )

Deletes the permission overwrite. This can be undone by created a new version of the same overwrite.

Returns: boolean

:getObject( )

Returns the object associated with this overwrite, either a role or member. This may make an HTTP request if the object is not cached.

Returns: Role|Member

:getAllowedPermissions( )

Returns a permissions object that represents the permissions that this overwrite explicitly allows.

Returns: Permissions

:getDeniedPermissions( )

Returns a permissions object that represents the permissions that this overwrite explicitly denies.

Returns: Permissions

:setPermissions( allowed, denied )

Sets the permissions that this overwrite explicitly allows and denies. This method does NOT resolve conflicts. Please be sure to use the correct parameters.

Name Type
allowed Permissions Resolvables
denied Permissions Resolvables

Returns: boolean

:setAllowedPermissions( allowed )

Sets the permissions that this overwrite explicitly allows.

Name Type
allowed Permissions Resolvables

Returns: boolean

:setDeniedPermissions( denied )

Sets the permissions that this overwrite explicitly denies.

Name Type
denied Permissions Resolvables

Returns: boolean

:allowPermissions( ... )

Allows individual permissions in this overwrite.

Name Type
... Permissions Resolvables

Returns: boolean

:denyPermissions( ... )

Denies individual permissions in this overwrite.

Name Type
... Permissions Resolvables

Returns: boolean

:clearPermissions( ... )

Clears individual permissions in this overwrite.

Name Type
... Permissions Resolvables

Returns: boolean

:allowAllPermissions( )

Allows all permissions in this overwrite.

Returns: boolean

:denyAllPermissions( )

Denies all permissions in this overwrite.

Returns: boolean

:clearAllPermissions( )

Clears all permissions in this overwrite.

Returns: boolean

Properties

.type

The overwrite type; either "role" or "member".

Type: string

.channel

The channel in which this overwrite exists.

Type: GuildChannel

.guild

The guild in which this overwrite exists. Equivalent to PermissionOverwrite.channel.guild.

Type: Guild

.allowedPermissions

The number representing the total permissions allowed by this overwrite.

Type: number

.deniedPermissions

The number representing the total permissions denied by this overwrite.

Type: number

Inherited from Container

.client

A shortcut to the client object to which this container is visible.

Type: Client

.parent

The parent object of to which this container is a child. For example, the parent of a role is the guild in which the role exists.

Type: Container|Client

Inherited from Snowflake

.id

The Snowflake ID that can be used to identify the object. This is guaranteed to be unique except in cases where an object shares the ID of its parent.

Type: string

.createdAt

The Unix time in seconds at which this object was created by Discord. Additional decimal points may be present, though only the first 3 (milliseconds) should be considered accurate.

Type: number

.timestamp

The date and time at which this object was created by Discord, represented as an ISO 8601 string plus microseconds when available.

Equivalent to Date.fromSnowflake(Snowflake.id):toISO().

Type: string

⚠️ **GitHub.com Fallback** ⚠️