Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types for the client
Synopsis
- data Client = Client {
- shards :: TVar [(InChan ControlMessage, Async (Maybe ()))]
- numShards :: MVar Int
- token :: Token
- rlState :: RateLimitState
- eventsIn :: InChan CalamityEvent
- eventsOut :: OutChan CalamityEvent
- type BotC r = (Members '[LogEff, MetricEff, CacheEff, Reader Client, AtomicState EventHandlers, Embed IO, Final IO, Async] r, Typeable r)
- type SetupEff r = Sem (LogEff ': (Reader Client ': (AtomicState EventHandlers ': (Async ': r)))) ()
- type family EHType (d :: EventType) m where ...
- newtype EventHandlers = EventHandlers (TypeRepMap EventHandler)
- newtype EventHandler t = EH {
- unwrapEventHandler :: (Semigroup (EHStorageType t), Monoid (EHStorageType t)) => EHStorageType t
- class InsertEventHandler a m where
- makeEventHandlers :: Proxy a -> Proxy m -> EHType a m -> EventHandlers
- class GetEventHandlers a m where
- getEventHandlers :: EventHandlers -> [EHType a m]
- data EventType
- = ReadyEvt
- | ChannelCreateEvt
- | ChannelUpdateEvt
- | ChannelDeleteEvt
- | ChannelpinsUpdateEvt
- | GuildCreateEvt
- | GuildUpdateEvt
- | GuildDeleteEvt
- | GuildBanAddEvt
- | GuildBanRemoveEvt
- | GuildEmojisUpdateEvt
- | GuildIntegrationsUpdateEvt
- | GuildMemberAddEvt
- | GuildMemberRemoveEvt
- | GuildMemberUpdateEvt
- | GuildMembersChunkEvt
- | GuildRoleCreateEvt
- | GuildRoleUpdateEvt
- | GuildRoleDeleteEvt
- | MessageCreateEvt
- | MessageUpdateEvt
- | MessageDeleteEvt
- | MessageDeleteBulkEvt
- | MessageReactionAddEvt
- | MessageReactionRemoveEvt
- | MessageReactionRemoveAllEvt
- | TypingStartEvt
- | UserUpdateEvt
- | forall s a. CustomEvt s a
- getCustomEventHandlers :: TypeRep -> TypeRep -> EventHandlers -> [Dynamic]
Documentation
Client | |
|
Instances
Generic Client Source # | |
type Rep Client Source # | |
Defined in Calamity.Client.Types type Rep Client = D1 ('MetaData "Client" "Calamity.Client.Types" "calamity-0.1.6.2-inplace" 'False) (C1 ('MetaCons "Client" 'PrefixI 'True) ((S1 ('MetaSel ('Just "shards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TVar [(InChan ControlMessage, Async (Maybe ()))])) :*: (S1 ('MetaSel ('Just "numShards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (MVar Int)) :*: S1 ('MetaSel ('Just "token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Token))) :*: (S1 ('MetaSel ('Just "rlState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RateLimitState) :*: (S1 ('MetaSel ('Just "eventsIn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (InChan CalamityEvent)) :*: S1 ('MetaSel ('Just "eventsOut") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OutChan CalamityEvent)))))) |
type BotC r = (Members '[LogEff, MetricEff, CacheEff, Reader Client, AtomicState EventHandlers, Embed IO, Final IO, Async] r, Typeable r) Source #
type SetupEff r = Sem (LogEff ': (Reader Client ': (AtomicState EventHandlers ': (Async ': r)))) () Source #
type family EHType (d :: EventType) m where ... Source #
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 |
newtype EventHandler t Source #
EH | |
|
Instances
Semigroup (EventHandler t) Source # | |
Defined in Calamity.Client.Types (<>) :: EventHandler t -> EventHandler t -> EventHandler t # sconcat :: NonEmpty (EventHandler t) -> EventHandler t # stimes :: Integral b => b -> EventHandler t -> EventHandler t # | |
Monoid (EventHandler t) Source # | |
Defined in Calamity.Client.Types mempty :: EventHandler t # mappend :: EventHandler t -> EventHandler t -> EventHandler t # mconcat :: [EventHandler t] -> EventHandler t # |
class InsertEventHandler a m where Source #
makeEventHandlers :: Proxy a -> Proxy m -> EHType a m -> EventHandlers Source #
Instances
(EHInstanceSelector a ~ flag, InsertEventHandler' flag a m) => InsertEventHandler a m Source # | |
Defined in Calamity.Client.Types makeEventHandlers :: Proxy a -> Proxy m -> EHType a m -> EventHandlers Source # |
class GetEventHandlers a m where Source #
getEventHandlers :: EventHandlers -> [EHType a m] Source #
Instances
(EHInstanceSelector a ~ flag, GetEventHandlers' flag a m) => GetEventHandlers a m Source # | |
Defined in Calamity.Client.Types getEventHandlers :: EventHandlers -> [EHType a m] Source # |
A Data Kind used to fire custom events
getCustomEventHandlers :: TypeRep -> TypeRep -> EventHandlers -> [Dynamic] Source #