Need to give the player their weapons from the dojo
This commit is contained in:
parent
8c33e109b0
commit
49f716bff7
@ -215,6 +215,10 @@ let handleArsenal (ctx : IDiscordContext) = PlayerInteractions.executePlayerActi
|
||||
Bank = player.Bank + CurrencyGift
|
||||
}
|
||||
do! DbService.updatePlayer updatedPlayer |> Async.Ignore
|
||||
if player.Inventory |> List.exists (fun i -> i.Id = hackItem.Id) |> not then
|
||||
do! DbService.addToPlayerInventory player.DiscordId hackItem |> Async.Ignore
|
||||
if player.Inventory |> List.exists (fun i -> i.Id = shieldItem.Id) |> not then
|
||||
do! DbService.addToPlayerInventory player.DiscordId shieldItem |> Async.Ignore
|
||||
try
|
||||
do! ShieldEvents () @ [ HackEvent () ]
|
||||
|> List.map (DbService.addPlayerEvent player.DiscordId)
|
||||
@ -238,8 +242,6 @@ let handleArsenal (ctx : IDiscordContext) = PlayerInteractions.executePlayerActi
|
||||
let role = ctx.GetGuild().GetRole(GuildEnvironment.roleHacker)
|
||||
do! ctx.GetDiscordMember().GrantRoleAsync(role) |> Async.AwaitTask
|
||||
|
||||
// do! InviteTracker.acceptInvite ctx player |> Async.AwaitTask
|
||||
|
||||
do! Async.Sleep 1000
|
||||
|
||||
do! sendFollowUpMessage ctx $"Now get out of there and go hack other Degenz in the <#{GuildEnvironment.channelBattle}> channel!"
|
||||
|
@ -286,31 +286,23 @@ let private processNewUser (eventArgs : GuildMemberAddEventArgs) =
|
||||
|
||||
let acceptInvite (guild : DiscordGuild) discordId memberName =
|
||||
task {
|
||||
printfn "1"
|
||||
match! checkInviteAccepted discordId with
|
||||
| false ->
|
||||
printfn "2"
|
||||
let! _ = markInvitedAccepted discordId |> Async.Ignore
|
||||
printfn "3"
|
||||
try
|
||||
let! invite = getInviteFromInvitedUser discordId
|
||||
printfn "4"
|
||||
let! player = DbService.tryFindPlayer invite.Inviter
|
||||
printfn "5"
|
||||
match player with
|
||||
| Some player ->
|
||||
do! DbService.updatePlayerCurrency InviteRewardAmount player.DiscordId |> Async.Ignore
|
||||
printfn "6"
|
||||
do! match GuildEnvironment.botClientRecruit with
|
||||
| Some recruitBot -> async {
|
||||
printfn "7"
|
||||
let builder = DiscordMessageBuilder()
|
||||
builder.WithContent($"{memberName} was recruited and is now a Degen. <@{player.DiscordId}> just earned {InviteRewardAmount} 💰$GBT for their efforts!") |> ignore
|
||||
let channel = guild.GetChannel(GuildEnvironment.channelEventsHackerBattle)
|
||||
do! recruitBot.SendMessageAsync(channel, builder)
|
||||
|> Async.AwaitTask
|
||||
|> Async.Ignore
|
||||
printfn "8"
|
||||
}
|
||||
| None -> async.Return()
|
||||
do! Analytics.invitedUserAccepted invite.Code player.DiscordId discordId player.Name memberName
|
||||
|
Loading…
x
Reference in New Issue
Block a user