75 lines
2.4 KiB
Forth

module Degenz.Bot
open System.Threading.Tasks
open DSharpPlus
open DSharpPlus.SlashCommands
open Degenz.Shared
open Emzi0767.Utilities
open Degenz.PlayerInteractions
open Degenz.SlotMachine
open Degenz.Trainer
open Degenz.HackerBattle
open Degenz.Store
type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule ()
let playerInteractionsConfig = DiscordConfiguration()
let trainerConfig = DiscordConfiguration()
let hackerBattleConfig = DiscordConfiguration()
let storeConfig = DiscordConfiguration()
let slotMachineConfig = DiscordConfiguration()
let configs = [| playerInteractionsConfig ; trainerConfig ; hackerBattleConfig ; storeConfig ; slotMachineConfig ; |]
for conf in configs do
conf.TokenType <- TokenType.Bot
conf.Intents <- DiscordIntents.All
playerInteractionsConfig.Token <- "OTIyNDIyMDIyMTI1MDEwOTU1.YcBOcw.JxfW1CSIwEO7j6RbRFCnPZ-HoTk"
trainerConfig.Token <- "OTMzMDg4MTQyNDM5ODk5MTg4.YeccDQ.AbysjlHICgbNQVyduG6aGIHNpdE"
hackerBattleConfig.Token <- "OTMyMzI5NDAzNjYzNDEzMjQ4.YeRZaw.ZyCo5L8HFsCvx8JuhdAwqrH3hZI"
storeConfig.Token <- "OTMyMzA3NTE0ODc4NDg4NjY2.YeRFCA.3NXX4tLObXU3rVgPt8D1fE58FnY"
slotMachineConfig.Token <- "OTMyMzQ3NzQ1NDE3NzE1ODE0.YeRqgA.PHandjk0jQGIxlM8NlqKc7cJD3s"
//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace
let playerInteractionsBot = new DiscordClient(playerInteractionsConfig)
let trainerBot = new DiscordClient(trainerConfig)
let hackerBattleBot = new DiscordClient(hackerBattleConfig)
let storeBot = new DiscordClient(storeConfig)
let slotMachineBot = new DiscordClient(slotMachineConfig)
let clients = [| playerInteractionsBot ; trainerBot ; hackerBattleBot ; storeBot ; slotMachineBot |]
let slashCommands =
clients
|> Array.map (fun c -> c.UseSlashCommands())
// My server
let joeServer = 922419263275425832uL
slashCommands.[0].RegisterCommands<PlayerInteractions>(joeServer);
slashCommands.[1].RegisterCommands<Trainer>(joeServer);
slashCommands.[2].RegisterCommands<HackerGame>(joeServer);
slashCommands.[3].RegisterCommands<Store>(joeServer);
slashCommands.[4].RegisterCommands<SlotMachine>(joeServer);
// Degenz
//slash.RegisterCommands<HackerGame>(922414052708327494uL);
let run (client : DiscordClient) =
async {
do! client.ConnectAsync () |> Async.AwaitTask
}
clients
|> Array.map run
|> Array.toSeq
|> Async.Parallel
|> Async.RunSynchronously
|> ignore
Task.Delay(-1)
|> Async.AwaitTask
|> Async.RunSynchronously