diff options
Diffstat (limited to 'deps/discord-haskell/examples/cache.hs')
| -rw-r--r-- | deps/discord-haskell/examples/cache.hs | 27 |
1 files changed, 27 insertions, 0 deletions
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 () + |
