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/examples/cache.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 deps/discord-haskell/examples/cache.hs (limited to 'deps/discord-haskell/examples/cache.hs') diff --git a/deps/discord-haskell/examples/cache.hs b/deps/discord-haskell/examples/cache.hs new file mode 100644 index 0000000..2e26f53 --- /dev/null +++ b/deps/discord-haskell/examples/cache.hs @@ -0,0 +1,27 @@ +{-# LANGUAGE OverloadedStrings #-} + +import UnliftIO (liftIO) + +import Discord + +import ExampleUtils (getToken) + +main :: IO () +main = cacheExample + +-- There's not much information in the Cache for now +-- but this program will show you what its got + +-- | Print cached Gateway info +cacheExample :: IO () +cacheExample = do + tok <- getToken + + _ <- runDiscord $ def { discordToken = tok + , discordOnStart = do + cache <- readCache + liftIO $ putStrLn ("Cached info from gateway: " <> show cache) + stopDiscord + } + pure () + -- cgit v1.2.3