Re-add actions

This commit is contained in:
Joseph Ferano 2022-01-31 22:00:59 +07:00
parent 0c91db2b12
commit 1bfcb4d32a
4 changed files with 10 additions and 9 deletions

View File

@ -25,10 +25,9 @@ let configs = [| playerInteractionsConfig ; hackerBattleConfig ; storeConfig |]
for conf in configs do for conf in configs do
conf.TokenType <- TokenType.Bot conf.TokenType <- TokenType.Bot
conf.Intents <- DiscordIntents.All conf.Intents <- DiscordIntents.All
let guild = GuildEnvironment.guildId let guild = GuildEnvironment.guildId
//playerInteractionsConfig.Token <- GuildEnvironment.tokenPlayerInteractions playerInteractionsConfig.Token <- GuildEnvironment.tokenPlayerInteractions
hackerBattleConfig.Token <- GuildEnvironment.tokenHackerBattle hackerBattleConfig.Token <- GuildEnvironment.tokenHackerBattle
storeConfig.Token <- GuildEnvironment.tokenStore storeConfig.Token <- GuildEnvironment.tokenStore
//slotMachineConfig.Token <- Environment.GetEnvironmentVariable("BOT_SLOT_MACHINE") //slotMachineConfig.Token <- Environment.GetEnvironmentVariable("BOT_SLOT_MACHINE")
@ -76,7 +75,7 @@ let run (client : DiscordClient) =
do! client.ConnectAsync () |> Async.AwaitTask do! client.ConnectAsync () |> Async.AwaitTask
} }
Trainer.sendInitialEmbed hackerBattleBot //Trainer.sendInitialEmbed hackerBattleBot
clients clients
|> Array.map run |> Array.map run

View File

@ -4,8 +4,8 @@ module Degenz.GuildEnvironment
open System open System
open dotenv.net open dotenv.net
//DotEnv.Load(DotEnvOptions(envFilePaths = [ "../../../../stag.env" ], overwriteExistingVars = false)) DotEnv.Load(DotEnvOptions(envFilePaths = [ "../../../../stag.env" ], overwriteExistingVars = false))
DotEnv.Load(DotEnvOptions(envFilePaths = [ "../../../../prod.env" ], overwriteExistingVars = false)) //DotEnv.Load(DotEnvOptions(envFilePaths = [ "../../../../prod.env" ], overwriteExistingVars = false))
let getVar str = Environment.GetEnvironmentVariable(str) let getVar str = Environment.GetEnvironmentVariable(str)
let getId str = getVar str |> uint64 let getId str = getVar str |> uint64

View File

@ -92,8 +92,8 @@ module Commands =
type PlayerInteractions() = type PlayerInteractions() =
inherit ApplicationCommandModule () inherit ApplicationCommandModule ()
// [<SlashCommand("redpill", "Take the redpill and become a hacker")>] [<SlashCommand("redpill", "Take the redpill and become a hacker")>]
// member _.AddHackerRole (ctx : InteractionContext) = Commands.addHackerRole ctx member _.AddHackerRole (ctx : InteractionContext) = Commands.addHackerRole ctx
[<SlashCommand("status", "Get your current status like bank account, and active hacks and defenses")>] [<SlashCommand("status", "Get your current status like bank account, and active hacks and defenses")>]
member this.Status (ctx : InteractionContext) = Commands.status ctx member this.Status (ctx : InteractionContext) = Commands.status ctx

View File

@ -52,8 +52,10 @@ let private playerMap (player : PlayerData) = {
DiscordId = player.DiscordId DiscordId = player.DiscordId
Name = player.Name Name = player.Name
Arsenal = player.Arsenal |> Array.map (fun w -> w.Id) Arsenal = player.Arsenal |> Array.map (fun w -> w.Id)
Attacks = [||] Attacks = player.Actions
Defenses = [||] |> Array.choose (fun a -> match a.Type with Attack ar -> Some (actionToAttack a ar) | _ -> None)
Defenses = player.Actions
|> Array.choose (fun a -> match a.Type with Defense -> Some (actionToDefense a) | _ -> None)
Bank = int player.Bank Bank = int player.Bank
} }