bug fix
This commit is contained in:
parent
239b040d4d
commit
c8e6f8d398
1 changed files with 10 additions and 2 deletions
|
|
@ -73,9 +73,15 @@ foreach ($winid in $new_win_matches) {
|
||||||
if ($null -eq $winid) { continue }
|
if ($null -eq $winid) { continue }
|
||||||
$winmatches = $player_matches.player_matches | Where-Object { $_.id -eq $winid }
|
$winmatches = $player_matches.player_matches | Where-Object { $_.id -eq $winid }
|
||||||
$telemetry = (invoke-webrequest @($winmatches.telemetry_url)[0]).content | convertfrom-json | where-object { ($_._T -eq 'LOGPLAYERTAKEDAMAGE') -or ($_._T -eq 'LOGPLAYERKILLV2') }
|
$telemetry = (invoke-webrequest @($winmatches.telemetry_url)[0]).content | convertfrom-json | where-object { ($_._T -eq 'LOGPLAYERTAKEDAMAGE') -or ($_._T -eq 'LOGPLAYERKILLV2') }
|
||||||
$players = $winmatches.stats.name
|
$players = ($winmatches | where-object {$_.stats.winPlace -eq 1}).stats.name
|
||||||
$match_stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$winid" -Method GET -Headers $headers
|
$match_stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$winid" -Method GET -Headers $headers
|
||||||
$all_winners_of_match = ($match_stats.included.attributes.stats | where-object { $_.winplace -eq 1 })
|
if($winmatches[0].matchType -eq 'custom'){
|
||||||
|
$all_winners_of_match = $match_stats.included.attributes.stats
|
||||||
|
}else{
|
||||||
|
$all_winners_of_match = ($match_stats.included.attributes.stats | where-object { $_.winplace -eq 1 })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
send-discord -content ":chicken: :chicken: **WINNER WINNER CHICKEN DINNER!!** :chicken: :chicken:"
|
send-discord -content ":chicken: :chicken: **WINNER WINNER CHICKEN DINNER!!** :chicken: :chicken:"
|
||||||
send-discord -content ":partying_face::partying_face::partying_face: Gefeliciteerd $($players -join ', ') :partying_face::partying_face::partying_face:"
|
send-discord -content ":partying_face::partying_face::partying_face: Gefeliciteerd $($players -join ', ') :partying_face::partying_face::partying_face:"
|
||||||
$match_settings = @"
|
$match_settings = @"
|
||||||
|
|
@ -83,10 +89,12 @@ foreach ($winid in $new_win_matches) {
|
||||||
match mode $($winmatches[0].gameMode)
|
match mode $($winmatches[0].gameMode)
|
||||||
match type $($winmatches[0].matchType)
|
match type $($winmatches[0].matchType)
|
||||||
map $($map_map[$winmatches[0].mapName])
|
map $($map_map[$winmatches[0].mapName])
|
||||||
|
id $($winmatches[0].id)
|
||||||
``````
|
``````
|
||||||
"@
|
"@
|
||||||
send-discord -content $match_settings
|
send-discord -content $match_settings
|
||||||
foreach ($player in $all_winners_of_match.name) {
|
foreach ($player in $all_winners_of_match.name) {
|
||||||
|
if($null -eq $player){continue}
|
||||||
write-output "creating table for player $player"
|
write-output "creating table for player $player"
|
||||||
$win_stats += [PSCustomObject]@{
|
$win_stats += [PSCustomObject]@{
|
||||||
Name = $player
|
Name = $player
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue