discord-bot-game/SlotMachine/SlotMachine.fs
2022-01-17 02:05:07 +07:00

44 lines
1.1 KiB
Forth

open System.Threading.Tasks
open DSharpPlus
open DSharpPlus.Entities
open DSharpPlus.SlashCommands
open Emzi0767.Utilities
open DegenzGame.Shared
type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule ()
type SlotMachine() =
inherit ApplicationCommandModule ()
[<SlashCommand("spin", "Want to try your luck?")>]
member this.AttackCommand (ctx : InteractionContext) =
()
let config = DiscordConfiguration()
config.Token <- "OTMyMzQ3NzQ1NDE3NzE1ODE0.YeRqgA.PHandjk0jQGIxlM8NlqKc7cJD3s"
config.TokenType <- TokenType.Bot
config.Intents <- DiscordIntents.All
//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace
let client = new DiscordClient(config)
let slash = client.UseSlashCommands()
// My server
slash.RegisterCommands<SlotMachine>(922419263275425832uL);
// Degenz
//slash.RegisterCommands<HackerGame>(922414052708327494uL);
client.ConnectAsync ()
|> Async.AwaitTask
|> Async.RunSynchronously
Task.Delay(-1)
|> Async.AwaitTask
|> Async.RunSynchronously
client.DisconnectAsync ()
|> Async.AwaitTask
|> Async.RunSynchronously