calamity-0.8.0.0: A library for writing discord bots in haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Calamity.Cache.Eff

Description

Effect for handling the cache

Synopsis

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

GetGuildChannel :: Snowflake GuildChannel -> CacheEff m (Maybe GuildChannel)

Get a GuildChannel 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 DMChannels 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

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

Set the User representing the bot itself

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

Get the User representing the bot itself

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

Set or Update a Guild in the cache

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

Get a Guild from the cache

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

Get all Guilds from the cache

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

Delete a Guild from the cache

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

Set or Update a DMChannel in the cache

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

Get a DMChannel from the cache

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

Get all DMChannels from the cache

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

Delete a DMChannel from the cache

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

Set or Update a User in the cache

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

Get a User from the cache

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

Get all Users from the cache

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

Delete a User from the cache

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

Flag a Guild as unavailable

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

Test if a Guild is flagged as unavailable

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

Get all UnavailableGuilds from the cache

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

Unflag a Guild from being unavailable

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

Add or Update a Message in the cache

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

Get a Message from the cache

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

Get all Messages from the cache

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

Delete a Message from the cache