Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data structures pertaining to gateway dispatch Event
s
Synopsis
- data Event
- = Ready Int User [GuildUnavailable] Text HostName (Maybe Shard) PartialApplication
- | Resumed [Text]
- | ChannelCreate Channel
- | ChannelUpdate Channel
- | ChannelDelete Channel
- | ThreadCreate Channel
- | ThreadUpdate Channel
- | ThreadMemberUpdate ThreadMemberUpdateFields
- | ThreadDelete Channel
- | ThreadListSync ThreadListSyncFields
- | ThreadMembersUpdate ThreadMembersUpdateFields
- | ChannelPinsUpdate ChannelId (Maybe UTCTime)
- | GuildCreate Guild GuildCreateData
- | GuildUpdate Guild
- | GuildDelete GuildUnavailable
- | GuildBanAdd GuildId User
- | GuildBanRemove GuildId User
- | GuildEmojiUpdate GuildId [Emoji]
- | GuildIntegrationsUpdate GuildId
- | GuildMemberAdd GuildId GuildMember
- | GuildMemberRemove GuildId User
- | GuildMemberUpdate GuildId [RoleId] User (Maybe Text)
- | GuildMemberChunk GuildId [GuildMember]
- | GuildRoleCreate GuildId Role
- | GuildRoleUpdate GuildId Role
- | GuildRoleDelete GuildId RoleId
- | MessageCreate Message
- | MessageUpdate ChannelId MessageId
- | MessageDelete ChannelId MessageId
- | MessageDeleteBulk ChannelId [MessageId]
- | MessageReactionAdd ReactionInfo
- | MessageReactionRemove ReactionInfo
- | MessageReactionRemoveAll ChannelId MessageId
- | MessageReactionRemoveEmoji ReactionRemoveInfo
- | PresenceUpdate PresenceInfo
- | TypingStart TypingInfo
- | UserUpdate User
- | InteractionCreate Interaction
- | UnknownEvent Text Object
- data EventInternalParse
- = InternalReady Int User [GuildUnavailable] Text HostName (Maybe Shard) PartialApplication
- | InternalResumed [Text]
- | InternalChannelCreate Channel
- | InternalChannelUpdate Channel
- | InternalChannelDelete Channel
- | InternalThreadCreate Channel
- | InternalThreadUpdate Channel
- | InternalThreadMemberUpdate ThreadMemberUpdateFields
- | InternalThreadDelete Channel
- | InternalThreadListSync ThreadListSyncFields
- | InternalThreadMembersUpdate ThreadMembersUpdateFields
- | InternalChannelPinsUpdate ChannelId (Maybe UTCTime)
- | InternalGuildCreate Guild GuildCreateData
- | InternalGuildUpdate Guild
- | InternalGuildDelete GuildUnavailable
- | InternalGuildBanAdd GuildId User
- | InternalGuildBanRemove GuildId User
- | InternalGuildEmojiUpdate GuildId [Emoji]
- | InternalGuildIntegrationsUpdate GuildId
- | InternalGuildMemberAdd GuildId GuildMember
- | InternalGuildMemberRemove GuildId User
- | InternalGuildMemberUpdate GuildId [RoleId] User (Maybe Text)
- | InternalGuildMemberChunk GuildId [GuildMember]
- | InternalGuildRoleCreate GuildId Role
- | InternalGuildRoleUpdate GuildId Role
- | InternalGuildRoleDelete GuildId RoleId
- | InternalMessageCreate Message
- | InternalMessageUpdate ChannelId MessageId
- | InternalMessageDelete ChannelId MessageId
- | InternalMessageDeleteBulk ChannelId [MessageId]
- | InternalMessageReactionAdd ReactionInfo
- | InternalMessageReactionRemove ReactionInfo
- | InternalMessageReactionRemoveAll ChannelId MessageId
- | InternalMessageReactionRemoveEmoji ReactionRemoveInfo
- | InternalPresenceUpdate PresenceInfo
- | InternalTypingStart TypingInfo
- | InternalUserUpdate User
- | InternalInteractionCreate Interaction
- | InternalUnknownEvent Text Object
- data PartialApplication = PartialApplication {}
- data GuildCreateData = GuildCreateData {
- guildCreateJoinedAt :: !UTCTime
- guildCreateLarge :: !Bool
- guildCreateUnavailable :: !(Maybe Bool)
- guildCreateMemberCount :: !Int
- guildCreateMembers :: ![GuildMember]
- guildCreateChannels :: ![Channel]
- guildCreateThreads :: ![Channel]
- guildCreatePresences :: ![PresenceInfo]
- guildCreateScheduledEvents :: ![ScheduledEvent]
- parseGuildCreate :: Object -> Parser EventInternalParse
- data ReactionInfo = ReactionInfo {}
- data ReactionRemoveInfo = ReactionRemoveInfo {}
- data TypingInfo = TypingInfo {}
- reparse :: (ToJSON a, FromJSON b) => a -> Parser b
- extractHostname :: String -> HostName
- eventParse :: Text -> Object -> Parser EventInternalParse
Documentation
Represents possible events sent by discord. Detailed information can be found at https://discord.com/developers/docs/topics/gateway.
Ready Int User [GuildUnavailable] Text HostName (Maybe Shard) PartialApplication | Contains the initial state information |
Resumed [Text] | Response to a |
ChannelCreate Channel | new guild channel created |
ChannelUpdate Channel | channel was updated |
ChannelDelete Channel | channel was deleted |
ThreadCreate Channel | thread created, also sent when being added to a private thread |
ThreadUpdate Channel | thread was updated |
ThreadMemberUpdate ThreadMemberUpdateFields | thread member for the current user was updated |
ThreadDelete Channel | thread was deleted |
ThreadListSync ThreadListSyncFields | sent when gaining access to a channel, contains all active threads in that channel |
ThreadMembersUpdate ThreadMembersUpdateFields | member or the current user was added or removed from a thread |
ChannelPinsUpdate ChannelId (Maybe UTCTime) | message was pinned or unpinned |
GuildCreate Guild GuildCreateData | lazy-load for unavailable guild, guild became available, or user joined a new guild |
GuildUpdate Guild | guild was updated |
GuildDelete GuildUnavailable | guild became unavailable, or user left/was removed from a guild |
GuildBanAdd GuildId User | user was banned from a guild |
GuildBanRemove GuildId User | user was unbanned from a guild |
GuildEmojiUpdate GuildId [Emoji] | guild emojis were updated |
GuildIntegrationsUpdate GuildId | guild integration was updated |
GuildMemberAdd GuildId GuildMember | new user joined a guild |
GuildMemberRemove GuildId User | user was removed from a guild |
GuildMemberUpdate GuildId [RoleId] User (Maybe Text) | guild member was updated |
GuildMemberChunk GuildId [GuildMember] | response to |
GuildRoleCreate GuildId Role | guild role was created |
GuildRoleUpdate GuildId Role | guild role was updated |
GuildRoleDelete GuildId RoleId | guild role was deleted |
MessageCreate Message | message was created |
MessageUpdate ChannelId MessageId | message was updated |
MessageDelete ChannelId MessageId | message was deleted |
MessageDeleteBulk ChannelId [MessageId] | multiple messages were deleted at once |
MessageReactionAdd ReactionInfo | user reacted to a message |
MessageReactionRemove ReactionInfo | user removed a reaction from a message |
MessageReactionRemoveAll ChannelId MessageId | all reactions were explicitly removed from a message |
MessageReactionRemoveEmoji ReactionRemoveInfo | all reactions for a given emoji were explicitly removed from a message |
PresenceUpdate PresenceInfo | user was updated |
TypingStart TypingInfo | user started typing in a channel |
UserUpdate User | properties about the user changed |
InteractionCreate Interaction | someone joined, left, or moved a voice channel |
UnknownEvent Text Object | An Unknown Event, none of the others |
data EventInternalParse Source #
Internal Event representation. Each matches to the corresponding constructor of Event
.
An application should never have to use those directly
Instances
Read EventInternalParse Source # | |
Defined in Discord.Internal.Types.Events | |
Show EventInternalParse Source # | |
Defined in Discord.Internal.Types.Events showsPrec :: Int -> EventInternalParse -> ShowS # show :: EventInternalParse -> String # showList :: [EventInternalParse] -> ShowS # | |
Eq EventInternalParse Source # | |
Defined in Discord.Internal.Types.Events (==) :: EventInternalParse -> EventInternalParse -> Bool # (/=) :: EventInternalParse -> EventInternalParse -> Bool # |
data PartialApplication Source #
Structure containing partial information about an Application
Instances
FromJSON PartialApplication Source # | |
Defined in Discord.Internal.Types.Events | |
Read PartialApplication Source # | |
Defined in Discord.Internal.Types.Events | |
Show PartialApplication Source # | |
Defined in Discord.Internal.Types.Events showsPrec :: Int -> PartialApplication -> ShowS # show :: PartialApplication -> String # showList :: [PartialApplication] -> ShowS # | |
Eq PartialApplication Source # | |
Defined in Discord.Internal.Types.Events (==) :: PartialApplication -> PartialApplication -> Bool # (/=) :: PartialApplication -> PartialApplication -> Bool # |
data GuildCreateData Source #
Instances
Read GuildCreateData Source # | |
Defined in Discord.Internal.Types.Events | |
Show GuildCreateData Source # | |
Defined in Discord.Internal.Types.Events showsPrec :: Int -> GuildCreateData -> ShowS # show :: GuildCreateData -> String # showList :: [GuildCreateData] -> ShowS # | |
Eq GuildCreateData Source # | |
Defined in Discord.Internal.Types.Events (==) :: GuildCreateData -> GuildCreateData -> Bool # (/=) :: GuildCreateData -> GuildCreateData -> Bool # |
data ReactionInfo Source #
Structure containing information about a reaction
ReactionInfo | |
|
Instances
data ReactionRemoveInfo Source #
Structure containing information about a reaction that has been removed
Instances
data TypingInfo Source #
Structre containing typing status information
Instances
extractHostname :: String -> HostName Source #
Remove the "wss://" and the trailing slash in a gateway URL, thereby returning the hostname portion of the URL that we can connect to.
eventParse :: Text -> Object -> Parser EventInternalParse Source #
Parse an event from name and JSON data