You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. {-# LANGUAGE OverloadedStrings #-}
  2. module Main where
  3. import Control.Monad (when, void)
  4. import qualified Data.Text as T
  5. import qualified Data.Text.IO as TIO
  6. import UnliftIO (liftIO)
  7. import Discord
  8. import Discord.Types
  9. import qualified Discord.Requests as R
  10. import Commands
  11. import Discord.Internal.Rest (Activity(Activity))
  12. main :: IO ()
  13. main = do
  14. tok <- TIO.readFile "./auth.secret"
  15. err <- runDiscord $ def { discordToken = tok
  16. , discordOnStart = onDiscordStart
  17. , discordOnEnd = liftIO $ putStrLn "Ended"
  18. , discordOnEvent = onDiscordEvent
  19. , discordOnLog =
  20. \s -> TIO.putStrLn s >> TIO.putStrLn ""
  21. }
  22. TIO.putStrLn err
  23. onDiscordStart :: DiscordHandler ()
  24. onDiscordStart = do
  25. let activity =
  26. Activity
  27. {
  28. }
  29. onDiscordEvent :: Event -> DiscordHandler ()
  30. onDiscordEvent _ = return ()