Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Calamity.Utils.Permissions
Description
Permission utilities
Synopsis
- basePermissions :: Guild -> Member -> Permissions
- applyOverwrites :: GuildChannel -> Member -> Permissions -> Permissions
- class PermissionsIn a where
- permissionsIn :: a -> Member -> Permissions
- class PermissionsIn' a where
- permissionsIn' :: (BotC r, HasID User u) => a -> u -> Sem r Permissions
Documentation
basePermissions :: Guild -> Member -> Permissions Source #
Calculate a Member
's Permissions
in a Guild
applyOverwrites :: GuildChannel -> Member -> Permissions -> Permissions Source #
Apply any Overwrite
s for a GuildChannel
onto some Permissions
class PermissionsIn a where Source #
Things that Member
s have Permissions
in
Methods
permissionsIn :: a -> Member -> Permissions Source #
Calculate a Member
's Permissions
in something
If permissions could not be calculated because something couldn't be found
in the cache, this will return an empty set of permissions. Use
permissionsIn'
if you want to handle cases where something might not exist
in cache.
Instances
PermissionsIn Guild Source # | A |
Defined in Calamity.Utils.Permissions Methods permissionsIn :: Guild -> Member -> Permissions Source # | |
PermissionsIn (Guild, GuildChannel) Source # | A |
Defined in Calamity.Utils.Permissions Methods permissionsIn :: (Guild, GuildChannel) -> Member -> Permissions Source # |
class PermissionsIn' a where Source #
A variant of PermissionsIn
that will use the cache/http.
Methods
permissionsIn' :: (BotC r, HasID User u) => a -> u -> Sem r Permissions Source #
Calculate the permissions of something that has a User
id
Instances
PermissionsIn' GuildChannel Source # | A This will fetch the guild from the cache or http as needed |
Defined in Calamity.Utils.Permissions Methods permissionsIn' :: forall (r :: EffectRow) u. (BotC r, HasID User u) => GuildChannel -> u -> Sem r Permissions Source # | |
PermissionsIn' Guild Source # | A |
Defined in Calamity.Utils.Permissions Methods permissionsIn' :: forall (r :: EffectRow) u. (BotC r, HasID User u) => Guild -> u -> Sem r Permissions Source # | |
PermissionsIn' (Snowflake GuildChannel) Source # | A This will fetch the guild and channel from the cache or http as needed |
Defined in Calamity.Utils.Permissions Methods permissionsIn' :: forall (r :: EffectRow) u. (BotC r, HasID User u) => Snowflake GuildChannel -> u -> Sem r Permissions Source # | |
PermissionsIn' (Snowflake Guild) Source # | A This will fetch the guild from the cache or http as needed |
Defined in Calamity.Utils.Permissions |