calamity-0.1.8.0: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.Cache.Eff

Description

Effect for handling the cache

Documentation

data CacheEff m a where Source #

Constructors

SetBotUser :: User -> CacheEff m ()

Set the User representing the bot itself

GetBotUser :: CacheEff m (Maybe User)

Get the User representing the bot itself

SetGuild :: Guild -> CacheEff m ()

Set or Update a Guild in the cache

GetGuild :: Snowflake Guild -> CacheEff m (Maybe Guild)

Get a Guild from the cache

GetGuilds :: CacheEff m [Guild]

Get all Guilds from the cache

DelGuild :: Snowflake Guild -> CacheEff m ()

Delete a Guild from the cache

SetDM :: DMChannel -> CacheEff m ()

Set or Update a DMChannel in the cache

GetDM :: Snowflake DMChannel -> CacheEff m (Maybe DMChannel)

Get a DMChannel from the cache

GetDMs :: CacheEff m [DMChannel]

Get all DMs from the cache

DelDM :: Snowflake DMChannel -> CacheEff m ()

Delete a DMChannel from the cache

SetUser :: User -> CacheEff m ()

Set or Update a User in the cache

GetUser :: Snowflake User -> CacheEff m (Maybe User)

Get a User from the cache

GetUsers :: CacheEff m [User]

Get all Users from the cache

DelUser :: Snowflake User -> CacheEff m ()

Delete a User from the cache

SetUnavailableGuild :: Snowflake Guild -> CacheEff m ()

Flag a Guild as unavailable

IsUnavailableGuild :: Snowflake Guild -> CacheEff m Bool

Test if a Guild is flagged as unavailable

GetUnavailableGuilds :: CacheEff m [Snowflake Guild]

Get all UnavailableGuilds from the cache

DelUnavailableGuild :: Snowflake Guild -> CacheEff m ()

Unflag a Guild from being unavailable

SetMessage :: Message -> CacheEff m ()

Add or Update a Message in the cache

GetMessage :: Snowflake Message -> CacheEff m (Maybe Message)

Get a Message from the cache

GetMessages :: CacheEff m [Message]

Get all Messages from the cache

DelMessage :: Snowflake Message -> CacheEff m ()

Delete a Message from the cache

Instances

Instances details
type DefiningModule (CacheEff :: k -> Type -> Type) Source # 
Instance details

Defined in Calamity.Cache.Eff

type DefiningModule (CacheEff :: k -> Type -> Type) = "Calamity.Cache.Eff"

setBotUser :: forall r. MemberWithError CacheEff r => User -> Sem r () Source #

updateBotUser :: Member CacheEff r => (User -> User) -> Sem r () Source #

getBotUser :: forall r. MemberWithError CacheEff r => Sem r (Maybe User) Source #

setGuild :: forall r. MemberWithError CacheEff r => Guild -> Sem r () Source #

updateGuild :: Member CacheEff r => Snowflake Guild -> (Guild -> Guild) -> Sem r () Source #

getGuild :: forall r. MemberWithError CacheEff r => Snowflake Guild -> Sem r (Maybe Guild) Source #

getGuilds :: forall r. MemberWithError CacheEff r => Sem r [Guild] Source #

delGuild :: forall r. MemberWithError CacheEff r => Snowflake Guild -> Sem r () Source #

setDM :: forall r. MemberWithError CacheEff r => DMChannel -> Sem r () Source #

updateDM :: Member CacheEff r => Snowflake DMChannel -> (DMChannel -> DMChannel) -> Sem r () Source #

getDM :: forall r. MemberWithError CacheEff r => Snowflake DMChannel -> Sem r (Maybe DMChannel) Source #

getDMs :: forall r. MemberWithError CacheEff r => Sem r [DMChannel] Source #

delDM :: forall r. MemberWithError CacheEff r => Snowflake DMChannel -> Sem r () Source #

setUser :: forall r. MemberWithError CacheEff r => User -> Sem r () Source #

updateUser :: Member CacheEff r => Snowflake User -> (User -> User) -> Sem r () Source #

getUser :: forall r. MemberWithError CacheEff r => Snowflake User -> Sem r (Maybe User) Source #

getUsers :: forall r. MemberWithError CacheEff r => Sem r [User] Source #

delUser :: forall r. MemberWithError CacheEff r => Snowflake User -> Sem r () Source #

setUnavailableGuild :: forall r. MemberWithError CacheEff r => Snowflake Guild -> Sem r () Source #

isUnavailableGuild :: forall r. MemberWithError CacheEff r => Snowflake Guild -> Sem r Bool Source #

getUnavailableGuilds :: forall r. MemberWithError CacheEff r => Sem r [Snowflake Guild] Source #

delUnavailableGuild :: forall r. MemberWithError CacheEff r => Snowflake Guild -> Sem r () Source #

setMessage :: forall r. MemberWithError CacheEff r => Message -> Sem r () Source #

updateMessage :: Member CacheEff r => Snowflake Message -> (Message -> Message) -> Sem r () Source #

getMessage :: forall r. MemberWithError CacheEff r => Snowflake Message -> Sem r (Maybe Message) Source #

getMessages :: forall r. MemberWithError CacheEff r => Sem r [Message] Source #

delMessage :: forall r. MemberWithError CacheEff r => Snowflake Message -> Sem r () Source #