discord-haskell-1.14.0: Write bots for Discord in Haskell
Safe HaskellNone
LanguageHaskell2010

Discord.Internal.Types.Events

Description

Data structures pertaining to gateway dispatch Events

Synopsis

Documentation

data Event Source #

Represents possible events sent by discord. Detailed information can be found at https://discord.com/developers/docs/topics/gateway.

Constructors

Ready Int User [Channel] [GuildUnavailable] Text (Maybe Shard) PartialApplication

Contains the initial state information

Resumed [Text]

Response to a Resume gateway command

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

ThreadDelete Channel

thread was deleted

ThreadListSync ThreadListSyncFields

sent when gaining access to a channel, contains all active threads in that channel

ThreadMembersUpdate ThreadMembersUpdateFields

thread member for the current user was updated

ChannelPinsUpdate ChannelId (Maybe UTCTime)

message was pinned or unpinned

GuildCreate Guild

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 Request Guild Members gateway command

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

Instances

Instances details
Eq Event Source # 
Instance details

Defined in Discord.Internal.Types.Events

Methods

(==) :: Event -> Event -> Bool #

(/=) :: Event -> Event -> Bool #

Show Event Source # 
Instance details

Defined in Discord.Internal.Types.Events

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

data EventInternalParse Source #

Internal Event representation. Each matches to the corresponding constructor of Event.

An application should never have to use those directly

Constructors

InternalReady Int User [Channel] [GuildUnavailable] Text (Maybe Shard) PartialApplication 
InternalResumed [Text] 
InternalChannelCreate Channel 
InternalChannelUpdate Channel 
InternalChannelDelete Channel 
InternalThreadCreate Channel 
InternalThreadUpdate Channel 
InternalThreadDelete Channel 
InternalThreadListSync ThreadListSyncFields 
InternalThreadMembersUpdate ThreadMembersUpdateFields 
InternalChannelPinsUpdate ChannelId (Maybe UTCTime) 
InternalGuildCreate Guild 
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 ReactionInfo Source #

Structure containing information about a reaction

Constructors

ReactionInfo 

Fields

data ReactionRemoveInfo Source #

Structure containing information about a reaction that has been removed

reparse :: (ToJSON a, FromJSON b) => a -> Parser b Source #

Convert ToJSON value to FromJSON value

eventParse :: Text -> Object -> Parser EventInternalParse Source #

Parse an event from name and JSON data