calamity-0.1.26.0: A library for writing discord bots in haskell
Safe HaskellNone
LanguageHaskell2010

Calamity.Client.Types

Description

Types for the client

Synopsis

Documentation

data Client Source #

newtype StartupError Source #

Constructors

StartupError String 

Instances

Instances details
Show StartupError Source # 
Instance details

Defined in Calamity.Client.Types

data EventType Source #

A Data Kind used to fire custom events

Constructors

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 to see updates of uncached messages

RawMessageUpdateEvt

Fired when a message is updated

MessageDeleteEvt

Fired when a cached message is deleted, use RawMessageDeleteEvt to see deletes of uncached messages.

Does not include messages deleted through bulk deletes, use MessageDeleteBulkEvt for those

RawMessageDeleteEvt

Fired when a message is deleted.

Does not include messages deleted through bulk deletes, use RawMessageDeleteBulkEvt for those

MessageDeleteBulkEvt

Fired when messages are bulk deleted. Only includes cached messages, use RawMessageDeleteBulkEvt to see deletes of uncached messages.

RawMessageDeleteBulkEvt

Fired when messages are bulk deleted.

MessageReactionAddEvt

Fired when a reaction is added to a cached message, use RawMessageReactionAddEvt to see reactions on uncached messages.

RawMessageReactionAddEvt

Fired when a reaction is added to a message.

MessageReactionRemoveEvt

Fired when a reaction is removed from a cached message, use RawMessageReactionRemoveEvt to see reactions on uncached messages.

RawMessageReactionRemoveEvt

Fired when a reaction is removed from a message.

MessageReactionRemoveAllEvt

Fired when all reactions are removed from a cached message, use RawMessageReactionRemoveEvt to see reactions on uncached messages.

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, s is the name and a is the data sent to the handler

Instances

Instances details
(EHInstanceSelector a ~ flag, RemoveEventHandler' flag a) => RemoveEventHandler (a :: EventType) Source # 
Instance details

Defined in Calamity.Client.Types

data GuildCreateStatus Source #

Constructors

GuildCreateNew

The guild was just joined

GuildCreateAvailable

The guild is becoming available

Instances

Instances details
Show GuildCreateStatus Source # 
Instance details

Defined in Calamity.Client.Types

Generic GuildCreateStatus Source # 
Instance details

Defined in Calamity.Client.Types

Associated Types

type Rep GuildCreateStatus :: Type -> Type #

TextShow GuildCreateStatus Source # 
Instance details

Defined in Calamity.Client.Types

type Rep GuildCreateStatus Source # 
Instance details

Defined in Calamity.Client.Types

type Rep GuildCreateStatus = D1 ('MetaData "GuildCreateStatus" "Calamity.Client.Types" "calamity-0.1.26.0-8Rbyh2JfYBvC9UHgZLNZiA" 'False) (C1 ('MetaCons "GuildCreateNew" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GuildCreateAvailable" 'PrefixI 'False) (U1 :: Type -> Type))

data GuildDeleteStatus Source #

Constructors

GuildDeleteUnavailable

The guild became unavailable

GuildDeleteRemoved

The bot was removed from the guild

Instances

Instances details
Show GuildDeleteStatus Source # 
Instance details

Defined in Calamity.Client.Types

Generic GuildDeleteStatus Source # 
Instance details

Defined in Calamity.Client.Types

Associated Types

type Rep GuildDeleteStatus :: Type -> Type #

TextShow GuildDeleteStatus Source # 
Instance details

Defined in Calamity.Client.Types

type Rep GuildDeleteStatus Source # 
Instance details

Defined in Calamity.Client.Types

type Rep GuildDeleteStatus = D1 ('MetaData "GuildDeleteStatus" "Calamity.Client.Types" "calamity-0.1.26.0-8Rbyh2JfYBvC9UHgZLNZiA" 'False) (C1 ('MetaCons "GuildDeleteUnavailable" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GuildDeleteRemoved" 'PrefixI 'False) (U1 :: Type -> Type))

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.

Equations

EHType 'ReadyEvt = ReadyData 
EHType 'ChannelCreateEvt = Channel 
EHType 'ChannelUpdateEvt = (Channel, Channel) 
EHType 'ChannelDeleteEvt = Channel 
EHType 'ChannelpinsUpdateEvt = (Channel, Maybe UTCTime) 
EHType 'GuildCreateEvt = (Guild, GuildCreateStatus) 
EHType 'GuildUpdateEvt = (Guild, Guild) 
EHType 'GuildDeleteEvt = (Guild, GuildDeleteStatus) 
EHType 'GuildBanAddEvt = (Guild, User) 
EHType 'GuildBanRemoveEvt = (Guild, User) 
EHType 'GuildEmojisUpdateEvt = (Guild, [Emoji]) 
EHType 'GuildIntegrationsUpdateEvt = Guild 
EHType 'GuildMemberAddEvt = Member 
EHType 'GuildMemberRemoveEvt = Member 
EHType 'GuildMemberUpdateEvt = (Member, Member) 
EHType 'GuildMembersChunkEvt = (Guild, [Member]) 
EHType 'GuildRoleCreateEvt = (Guild, Role) 
EHType 'GuildRoleUpdateEvt = (Guild, Role, Role) 
EHType 'GuildRoleDeleteEvt = (Guild, Role) 
EHType 'InviteCreateEvt = InviteCreateData 
EHType 'InviteDeleteEvt = InviteDeleteData 
EHType 'MessageCreateEvt = Message 
EHType 'MessageUpdateEvt = (Message, Message) 
EHType 'MessageDeleteEvt = Message 
EHType 'MessageDeleteBulkEvt = [Message] 
EHType 'MessageReactionAddEvt = (Message, Reaction) 
EHType 'MessageReactionRemoveEvt = (Message, Reaction) 
EHType 'MessageReactionRemoveAllEvt = Message 
EHType 'RawMessageUpdateEvt = UpdatedMessage 
EHType 'RawMessageDeleteEvt = Snowflake Message 
EHType 'RawMessageDeleteBulkEvt = [Snowflake Message] 
EHType 'RawMessageReactionAddEvt = Reaction 
EHType 'RawMessageReactionRemoveEvt = Reaction 
EHType 'RawMessageReactionRemoveAllEvt = Snowflake Message 
EHType 'TypingStartEvt = (Channel, Snowflake User, UnixTimestamp) 
EHType 'UserUpdateEvt = (User, User) 
EHType 'VoiceStateUpdateEvt = (Maybe VoiceState, VoiceState) 
EHType ('CustomEvt s a) = a 

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

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.

Methods

makeEventHandlers :: Proxy a -> Integer -> StoredEHType a -> EventHandlers Source #

Instances

Instances details
(EHInstanceSelector a ~ flag, InsertEventHandler' flag a) => InsertEventHandler a Source # 
Instance details

Defined in Calamity.Client.Types

Methods

makeEventHandlers :: Proxy a -> Integer -> StoredEHType a -> EventHandlers Source #

class RemoveEventHandler a where Source #

Instances

Instances details
(EHInstanceSelector a ~ flag, RemoveEventHandler' flag a) => RemoveEventHandler (a :: EventType) Source # 
Instance details

Defined in Calamity.Client.Types

getEventHandlers :: GetEventHandlers a => EventHandlers -> [StoredEHType a] Source #