module Joebot.Program open System open System.Threading.Tasks open DSharpPlus open DSharpPlus.Entities open DSharpPlus.EventArgs open DSharpPlus.SlashCommands open Emzi0767.Utilities open Joebot.Types open Joebot.Commands type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () type JoeBot() = inherit ApplicationCommandModule () [] member _.AddHackerRole (ctx : InteractionContext) = Commands.addHackerRole ctx [] member _.RemoveHackerRole (ctx : InteractionContext) = Commands.removeHackerRole ctx [] member this.AttackCommand (ctx : InteractionContext, [] target : DiscordUser) = Commands.attack ctx target [] member this.DefendCommand (ctx : InteractionContext) = Commands.defend ctx [] member this.Status (ctx : InteractionContext) = Commands.status ctx [] member this.Leaderboard (ctx : InteractionContext) = Commands.leaderboard ctx let config = DiscordConfiguration() config.Token <- "OTIyNDIyMDIyMTI1MDEwOTU1.YcBOcw.JxfW1CSIwEO7j6RbRFCnPZ-HoTk" config.TokenType <- TokenType.Bot config.Intents <- DiscordIntents.All //config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace let client = new DiscordClient(config) client.add_ComponentInteractionCreated(AsyncEventHandler(handleButtonEvent)) let slash = client.UseSlashCommands() slash.RegisterCommands(922414052708327494uL); client.ConnectAsync () |> Async.AwaitTask |> Async.RunSynchronously Task.Delay(-1) |> Async.AwaitTask |> Async.RunSynchronously client.DisconnectAsync () |> Async.AwaitTask |> Async.RunSynchronously