Liking cljdoc? Tell your friends :D

discljord.permissions

Functions for determining users' permissions.

Functions for determining users' permissions.
raw docstring

has-permission-flag?clj

(has-permission-flag? perm perms-int)

Returns if the given permission integer includes a permission flag.

perm is a keyword from the keys of permissions-bit.

Returns if the given permission integer includes a permission flag.

`perm` is a keyword from the keys of [[permissions-bit]].
sourceraw docstring

has-permission-flags?clj

(has-permission-flags? perms perms-int)

Returns if the given permission integer includes all the given permission flags.

perm is a keyword from the keys of permissions-bit.

Returns if the given permission integer includes all the given permission flags.

`perm` is a keyword from the keys of [[permissions-bit]].
sourceraw docstring

has-permission?clj

(has-permission? perm everyone roles)
(has-permission? perm guild user-id-or-member)
(has-permission? perm guild user-id-or-member channel-id)
(has-permission? perm
                 everyone
                 roles
                 everyone-overrides
                 roles-overrides
                 user-overrides)

Returns if the given user has a permission.

perm is a keyword from the keys of permissions-bit. everyone is a permissions integer. roles is a sequence of permissions integers. guild is a guild object like those from discljord.events.state/prepare-guild.

If not passed a guild object, the calling code will have to construct the list of overrides and role permissions ints itself. See permission-int for documentation of override objects.

Returns if the given user has a permission.

`perm` is a keyword from the keys of [[permissions-bit]].
`everyone` is a permissions integer.
`roles` is a sequence of permissions integers.
`guild` is a guild object like those from [[discljord.events.state/prepare-guild]].

If not passed a guild object, the calling code will have to construct the list
of overrides and role permissions ints itself. See [[permission-int]] for
documentation of override objects.
sourceraw docstring

has-permissions?clj

(has-permissions? perms everyone roles)
(has-permissions? perms guild user-id-or-member)
(has-permissions? perms guild user-id-or-member channel-id)
(has-permissions? perms
                  everyone
                  roles
                  everyone-overrides
                  roles-overrides
                  user-overrides)

Returns if the given user has each of a sequence of permissions.

perms is a sequence of keywords from the keys of permissions-bit. everyone is a permissions integer. roles is a sequence of permissions integers. guild is a guild object like those from discljord.events.state/prepare-guild.

If not passed a guild object, the calling code will have to construct the list of overrides and role permissions ints itself. See permission-int for documentation of override objects.

Returns if the given user has each of a sequence of permissions.

`perms` is a sequence of keywords from the keys of [[permissions-bit]].
`everyone` is a permissions integer.
`roles` is a sequence of permissions integers.
`guild` is a guild object like those from [[discljord.events.state/prepare-guild]].

If not passed a guild object, the calling code will have to construct the list
of overrides and role permissions ints itself. See [[permission-int]] for
documentation of override objects.
sourceraw docstring

permission-flagsclj

(permission-flags perms-int)

Returns a set of all permissions included in a given permission integer.

Returns a set of all permissions included in a given permission integer.
sourceraw docstring

permission-intclj

(permission-int perms)
(permission-int everyone roles)
(permission-int everyone roles everyone-override roles-overrides user-override)

Constructs a permissions integer from role permissions integers and overrides or a sequence of permissions.

perms is a sequence or collection of permission names (keywords as defined in permissions-bit).

everyone is a permissions integer. roles is a sequence of permissions integers.

Each of the override objects is an overwrite object from their respective items (everyone, roles, and member overrides).

roles-overrides is a sequence of these objects.

Constructs a permissions integer from role permissions integers and overrides or a sequence of permissions.

`perms` is a sequence or collection of permission names (keywords as defined in [[permissions-bit]]).

`everyone` is a permissions integer.
`roles` is a sequence of permissions integers.

Each of the override objects is an [overwrite object](https://discord.com/developers/docs/resources/channel#overwrite-object)
from their respective items (everyone, roles, and member overrides).

`roles-overrides` is a sequence of these objects.
sourceraw docstring

permissions-bitclj

Map from permission names to the binary flag representation of it.

Map from permission names to the binary flag representation of it.
sourceraw docstring

permissions-keyclj

Map from binary flag representation to permission name.

Map from binary flag representation to permission name.
sourceraw docstring

user-rolesclj

(user-roles guild user-id-or-member)

Returns a sequence of permissions integers for a user's roles.

guild is a guild object like those returned from discljord.events.state/prepare-guild or stored in the state atom from discljord.events.state/caching-middleware.

This is primarily used to construct calls to permission-int.

Returns a sequence of permissions integers for a user's roles.

`guild` is a guild object like those returned from
[[discljord.events.state/prepare-guild]] or stored in the state atom from
[[discljord.events.state/caching-middleware]].

This is primarily used to construct calls to [[permission-int]].
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close