Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides a convenience framework for writing Discord bots without dealing with Pipes
- asyncState :: Client a => a -> Effect DiscordM DiscordState
- data BotClient = BotClient Auth
- runBot :: Auth -> DiscordBot BotClient () -> IO ()
- runBotWith :: Client a => a -> DiscordBot a () -> IO ()
- runAsync :: Client client => Proxy client -> Effect DiscordM () -> Effect DiscordM ()
- type DiscordBot c a = Writer (Handle c) a
- data Client c => Handle c
- = 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 ())
- clientProxy :: Handle c -> Proxy c
- with :: Client c => (a -> Handle c) -> a -> DiscordBot c ()
- handle :: Client a => Handle a -> Event -> Effect DiscordM ()
Documentation
asyncState :: Client a => a -> Effect DiscordM DiscordState Source #
Isolated state representation for use with async event handling
Basic client implementation. Most likely suitable for most bots.
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
clientProxy :: Handle c -> Proxy c Source #
with :: Client c => (a -> Handle c) -> a -> DiscordBot c () Source #
Register an Event Handle
in the DiscordBot
monad