From dcef0b65069fb38fd0f6c4382353167f603ebff1 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Thu, 16 Nov 2023 19:06:43 -0500 Subject: Initial commit --- deps/discord-haskell/docs/debugging.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 deps/discord-haskell/docs/debugging.md (limited to 'deps/discord-haskell/docs/debugging.md') diff --git a/deps/discord-haskell/docs/debugging.md b/deps/discord-haskell/docs/debugging.md new file mode 100644 index 0000000..5576a55 --- /dev/null +++ b/deps/discord-haskell/docs/debugging.md @@ -0,0 +1,29 @@ + +### Debugging + + +```haskell +example :: IO () +example = do userFacingError <- runDiscord $ def + { discordToken = "Bot ZZZZZZZZZZZZZZZZZZZ" + + -- discordOnLog :: T.Text -> IO () + , discordOnLog = \s -> TIO.putStrLn s >> TIO.putStrLn "" + } + + -- userFacingError :: T.Text + TIO.putStrLn userFacingError + +``` + + +1. Always print the `userFacingError` Text returned from `runDiscord`. This is used for errors that cannot be recovered from. + +2. Use the `discordOnLog` handler to print debugging information as it happens. + + +If something else goes wrong with the library please open an issue. It is helpful, +but not always necessary, to attach a log. + +Assign a handler to the `discordOnLog :: Text -> IO ()` to print info as it happens. +Remember to remove sensitive information before posting. -- cgit v1.2.3