A4IX64FMBOLH5PQPR6VY6XAC4V7SGKXIBGTTTA65L57LVJKHHVPAC packages: . vendor/discord-haskell
slashDiffCommand :: Maybe CreateApplicationCommandslashDiffCommand = options <$> createChatInput "diff" "Check the diff of two decklists"whereoptions command =command{ createOptions =Just $OptionsValues[ OptionValueAttachment "old" Nothing "Old decklist" Nothing True, OptionValueAttachment "new" Nothing "New decklist" Nothing True]}
onReady :: ApplicationId -> DiscordHandler ()onReady appId = case slashDiffCommand ofNothing -> pure ()Just command -> dores <- restCall $ Request.CreateGlobalApplicationCommand appId commandcase res ofLeft e -> liftIO $ print eRight validCmds -> doliftIO $ putStrLn "Command successfully registered"registered <- restCall $ Request.GetGlobalApplicationCommands appIdcase registered ofLeft _ -> liftIO $ putStrLn "error occured"Right cmds -> dolet validId = applicationCommandId validCmdsoutdatedIds = filter (/= validId) . map applicationCommandId $ cmdsin forM_ outdatedIds $restCall . Request.DeleteGlobalApplicationCommand appId