Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types for the client
Synopsis
- data Client = Client {}
- newtype StartupError = StartupError String
- data EventType
- = ReadyEvt
- | ChannelCreateEvt
- | ChannelUpdateEvt
- | ChannelDeleteEvt
- | ChannelpinsUpdateEvt
- | GuildCreateEvt
- | GuildUpdateEvt
- | GuildDeleteEvt
- | GuildBanAddEvt
- | GuildBanRemoveEvt
- | GuildEmojisUpdateEvt
- | GuildIntegrationsUpdateEvt
- | GuildMemberAddEvt
- | GuildMemberRemoveEvt
- | GuildMemberUpdateEvt
- | GuildMembersChunkEvt
- | GuildRoleCreateEvt
- | GuildRoleUpdateEvt
- | GuildRoleDeleteEvt
- | InviteCreateEvt
- | InviteDeleteEvt
- | MessageCreateEvt
- | MessageUpdateEvt
- | RawMessageUpdateEvt
- | MessageDeleteEvt
- | RawMessageDeleteEvt
- | MessageDeleteBulkEvt
- | RawMessageDeleteBulkEvt
- | MessageReactionAddEvt
- | RawMessageReactionAddEvt
- | MessageReactionRemoveEvt
- | RawMessageReactionRemoveEvt
- | MessageReactionRemoveAllEvt
- | RawMessageReactionRemoveAllEvt
- | TypingStartEvt
- | UserUpdateEvt
- | VoiceStateUpdateEvt
- | forall s a. CustomEvt s a
- data GuildCreateStatus
- data GuildDeleteStatus
- type family EHType (d :: EventType) where ...
- type BotC r = (Members '[LogEff, MetricEff, CacheEff, Reader Client, AtomicState EventHandlers, Embed IO, Final IO, Async] r, Typeable r)
- type SetupEff r = Reader Client ': (AtomicState EventHandlers ': (Async ': r))
- type ReactConstraints s = (InsertEventHandler s, RemoveEventHandler s)
- newtype EventHandlers = EventHandlers (TypeRepMap EventHandler)
- class InsertEventHandler a where
- makeEventHandlers :: Proxy a -> Integer -> StoredEHType a -> EventHandlers
- class RemoveEventHandler a where
- removeEventHandler :: Proxy a -> Integer -> EventHandlers -> EventHandlers
- getEventHandlers :: GetEventHandlers a => EventHandlers -> [StoredEHType a]
- getCustomEventHandlers :: TypeRep -> TypeRep -> EventHandlers -> [Dynamic -> IO ()]
Documentation
Instances
newtype StartupError Source #
Instances
Show StartupError Source # | |
Defined in Calamity.Client.Types showsPrec :: Int -> StartupError -> ShowS # show :: StartupError -> String # showList :: [StartupError] -> ShowS # |
A Data Kind used to fire custom events
ReadyEvt | |
ChannelCreateEvt | |
ChannelUpdateEvt | |
ChannelDeleteEvt | |
ChannelpinsUpdateEvt | |
GuildCreateEvt | |
GuildUpdateEvt | |
GuildDeleteEvt | |
GuildBanAddEvt | |
GuildBanRemoveEvt | |
GuildEmojisUpdateEvt | |
GuildIntegrationsUpdateEvt | |
GuildMemberAddEvt | |
GuildMemberRemoveEvt | |
GuildMemberUpdateEvt | |
GuildMembersChunkEvt | |
GuildRoleCreateEvt | |
GuildRoleUpdateEvt | |
GuildRoleDeleteEvt | |
InviteCreateEvt | |
InviteDeleteEvt | |
MessageCreateEvt | |
MessageUpdateEvt | Fired when a cached message is updated, use |
RawMessageUpdateEvt | Fired when a message is updated |
MessageDeleteEvt | Fired when a cached message is deleted, use Does not include messages deleted through bulk deletes, use
|
RawMessageDeleteEvt | Fired when a message is deleted. Does not include messages deleted through bulk deletes, use
|
MessageDeleteBulkEvt | Fired when messages are bulk deleted. Only includes cached messages, use
|
RawMessageDeleteBulkEvt | Fired when messages are bulk deleted. |
MessageReactionAddEvt | Fired when a reaction is added to a cached message, use
|
RawMessageReactionAddEvt | Fired when a reaction is added to a message. |
MessageReactionRemoveEvt | Fired when a reaction is removed from a cached message, use
|
RawMessageReactionRemoveEvt | Fired when a reaction is removed from a message. |
MessageReactionRemoveAllEvt | Fired when all reactions are removed from a cached message, use
The message passed will contain the removed events. |
RawMessageReactionRemoveAllEvt | Fired when all reactions are removed from a message. |
TypingStartEvt | |
UserUpdateEvt | |
VoiceStateUpdateEvt | Sent when someone joinsleavesmoves voice channels |
forall s a. CustomEvt s a | A custom event, |
Instances
(EHInstanceSelector a ~ flag, RemoveEventHandler' flag a) => RemoveEventHandler (a :: EventType) Source # | |
Defined in Calamity.Client.Types removeEventHandler :: Proxy a -> Integer -> EventHandlers -> EventHandlers Source # |
data GuildCreateStatus Source #
GuildCreateNew | The guild was just joined |
GuildCreateAvailable | The guild is becoming available |
Instances
Show GuildCreateStatus Source # | |
Defined in Calamity.Client.Types showsPrec :: Int -> GuildCreateStatus -> ShowS # show :: GuildCreateStatus -> String # showList :: [GuildCreateStatus] -> ShowS # | |
Generic GuildCreateStatus Source # | |
Defined in Calamity.Client.Types type Rep GuildCreateStatus :: Type -> Type # from :: GuildCreateStatus -> Rep GuildCreateStatus x # to :: Rep GuildCreateStatus x -> GuildCreateStatus # | |
TextShow GuildCreateStatus Source # | |
Defined in Calamity.Client.Types showbPrec :: Int -> GuildCreateStatus -> Builder # showb :: GuildCreateStatus -> Builder # showbList :: [GuildCreateStatus] -> Builder # showtPrec :: Int -> GuildCreateStatus -> Text # showt :: GuildCreateStatus -> Text # showtList :: [GuildCreateStatus] -> Text # showtlPrec :: Int -> GuildCreateStatus -> Text # showtl :: GuildCreateStatus -> Text # showtlList :: [GuildCreateStatus] -> Text # | |
type Rep GuildCreateStatus Source # | |
Defined in Calamity.Client.Types |
data GuildDeleteStatus Source #
GuildDeleteUnavailable | The guild became unavailable |
GuildDeleteRemoved | The bot was removed from the guild |
Instances
Show GuildDeleteStatus Source # | |
Defined in Calamity.Client.Types showsPrec :: Int -> GuildDeleteStatus -> ShowS # show :: GuildDeleteStatus -> String # showList :: [GuildDeleteStatus] -> ShowS # | |
Generic GuildDeleteStatus Source # | |
Defined in Calamity.Client.Types type Rep GuildDeleteStatus :: Type -> Type # from :: GuildDeleteStatus -> Rep GuildDeleteStatus x # to :: Rep GuildDeleteStatus x -> GuildDeleteStatus # | |
TextShow GuildDeleteStatus Source # | |
Defined in Calamity.Client.Types showbPrec :: Int -> GuildDeleteStatus -> Builder # showb :: GuildDeleteStatus -> Builder # showbList :: [GuildDeleteStatus] -> Builder # showtPrec :: Int -> GuildDeleteStatus -> Text # showt :: GuildDeleteStatus -> Text # showtList :: [GuildDeleteStatus] -> Text # showtlPrec :: Int -> GuildDeleteStatus -> Text # showtl :: GuildDeleteStatus -> Text # showtlList :: [GuildDeleteStatus] -> Text # | |
type Rep GuildDeleteStatus Source # | |
Defined in Calamity.Client.Types |
type family EHType (d :: EventType) where ... Source #
A type family to decide what the parameters for an event handler should be determined by the type of event it is handling.
type BotC r = (Members '[LogEff, MetricEff, CacheEff, Reader Client, AtomicState EventHandlers, Embed IO, Final IO, Async] r, Typeable r) Source #
type SetupEff r = Reader Client ': (AtomicState EventHandlers ': (Async ': r)) Source #
A concrete effect stack used inside the bot
type ReactConstraints s = (InsertEventHandler s, RemoveEventHandler s) Source #
Some constraints that react
needs to work. Don't
worry about these since they are satisfied for any type s
can be
newtype EventHandlers Source #
EventHandlers (TypeRepMap EventHandler) |
Instances
Semigroup EventHandlers Source # | |
Defined in Calamity.Client.Types (<>) :: EventHandlers -> EventHandlers -> EventHandlers # sconcat :: NonEmpty EventHandlers -> EventHandlers # stimes :: Integral b => b -> EventHandlers -> EventHandlers # | |
Monoid EventHandlers Source # | |
Defined in Calamity.Client.Types mempty :: EventHandlers # mappend :: EventHandlers -> EventHandlers -> EventHandlers # mconcat :: [EventHandlers] -> EventHandlers # | |
Default EventHandlers Source # | |
Defined in Calamity.Client.Types def :: EventHandlers # |
class InsertEventHandler a where Source #
A helper typeclass that is used to decide how to register regular events, and custom events which require storing in a map at runtime.
makeEventHandlers :: Proxy a -> Integer -> StoredEHType a -> EventHandlers Source #
Instances
(EHInstanceSelector a ~ flag, InsertEventHandler' flag a) => InsertEventHandler a Source # | |
Defined in Calamity.Client.Types makeEventHandlers :: Proxy a -> Integer -> StoredEHType a -> EventHandlers Source # |
class RemoveEventHandler a where Source #
removeEventHandler :: Proxy a -> Integer -> EventHandlers -> EventHandlers Source #
Instances
(EHInstanceSelector a ~ flag, RemoveEventHandler' flag a) => RemoveEventHandler (a :: EventType) Source # | |
Defined in Calamity.Client.Types removeEventHandler :: Proxy a -> Integer -> EventHandlers -> EventHandlers Source # |
getEventHandlers :: GetEventHandlers a => EventHandlers -> [StoredEHType a] Source #
getCustomEventHandlers :: TypeRep -> TypeRep -> EventHandlers -> [Dynamic -> IO ()] Source #