discord-hs-0.1.3: An API wrapper for Discord in Haskell

Safe HaskellNone
LanguageHaskell2010

Network.Discord.Framework

Description

Provides a convenience framework for writing Discord bots without dealing with Pipes

Synopsis

Documentation

asyncState :: Client a => a -> Effect DiscordM DiscordState Source #

Isolated state representation for use with async event handling

data BotClient Source #

Basic client implementation. Most likely suitable for most bots.

Constructors

BotClient Auth 

runBot :: Auth -> DiscordBot BotClient () -> IO () Source #

This should be the entrypoint for most Discord bots.

runBotWith :: Client a => a -> DiscordBot a () -> IO () Source #

A variant of runBot which allows the user to specify a custom client implementation.

runAsync :: Client client => Proxy client -> Effect DiscordM () -> Effect DiscordM () Source #

Utility function to split event handlers into a seperate thread

type DiscordBot c a = Writer (Handle c) a Source #

Monad to compose event handlers

data Client c => Handle c Source #

Event handlers for Gateway events. These correspond to events listed in Event

Constructors

Null 
Misc (Event -> Effect DiscordM ()) 
ReadyEvent (Init -> Effect DiscordM ()) 
ResumedEvent (Object -> Effect DiscordM ()) 
ChannelCreateEvent (Channel -> Effect DiscordM ()) 
ChannelUpdateEvent (Channel -> Effect DiscordM ()) 
ChannelDeleteEvent (Channel -> Effect DiscordM ()) 
GuildCreateEvent (Guild -> Effect DiscordM ()) 
GuildUpdateEvent (Guild -> Effect DiscordM ()) 
GuildDeleteEvent (Guild -> Effect DiscordM ()) 
GuildBanAddEvent (Member -> Effect DiscordM ()) 
GuildBanRemoveEvent (Member -> Effect DiscordM ()) 
GuildEmojiUpdateEvent (Object -> Effect DiscordM ()) 
GuildIntegrationsUpdateEvent (Object -> Effect DiscordM ()) 
GuildMemberAddEvent (Member -> Effect DiscordM ()) 
GuildMemberRemoveEvent (Member -> Effect DiscordM ()) 
GuildMemberUpdateEvent (Member -> Effect DiscordM ()) 
GuildMemberChunkEvent (Object -> Effect DiscordM ()) 
GuildRoleCreateEvent (Object -> Effect DiscordM ()) 
GuildRoleUpdateEvent (Object -> Effect DiscordM ()) 
GuildRoleDeleteEvent (Object -> Effect DiscordM ()) 
MessageCreateEvent (Message -> Effect DiscordM ()) 
MessageUpdateEvent (Message -> Effect DiscordM ()) 
MessageDeleteEvent (Object -> Effect DiscordM ()) 
MessageDeleteBulkEvent (Object -> Effect DiscordM ()) 
PresenceUpdateEvent (Object -> Effect DiscordM ()) 
TypingStartEvent (Object -> Effect DiscordM ()) 
UserSettingsUpdateEvent (Object -> Effect DiscordM ()) 
UserUpdateEvent (Object -> Effect DiscordM ()) 
VoiceStateUpdateEvent (Object -> Effect DiscordM ()) 
VoiceServerUpdateEvent (Object -> Effect DiscordM ()) 
Event String (Object -> Effect DiscordM ()) 

Instances

Client c => Monoid (Handle c) Source # 

Methods

mempty :: Handle c #

mappend :: Handle c -> Handle c -> Handle c #

mconcat :: [Handle c] -> Handle c #

clientProxy :: Handle c -> Proxy c Source #

Provides a typehint for the correct Client given an Event Handle

with :: Client c => (a -> Handle c) -> a -> DiscordBot c () Source #

Register an Event Handle in the DiscordBot monad

handle :: Client a => Handle a -> Event -> Effect DiscordM () Source #

Asynchronously run an Event Handle against a Gateway Event