Dev #276

Merged
OpzekerIT merged 2 commits from dev into main 2025-10-17 11:39:18 +00:00
2 changed files with 13 additions and 3 deletions
Showing only changes of commit c4ed5551ae - Show all commits

View file

@ -252,6 +252,13 @@ foreach ($winid in $new_win_matches) {
$match_stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$winid" -Method GET -Headers $headers
if ($winmatches[0].gameMode -eq 'tdm' ) {
continue
}
if (
($winmatches[0].matchtype -eq 'event' -and $winmatches[0].gameMode -ne 'ibr') -or
($winmatches[0].gameMode -eq 'tdm')
) {
Write-Output 'Skipping because of event or tdm'
continue
} #skip tdm matches
if ($winmatches[0].matchType -eq 'custom') {
$players_to_report = $match_stats.included.attributes.stats | where-object { $_.playerId -notlike "ai.*" }
@ -263,7 +270,7 @@ foreach ($winid in $new_win_matches) {
if ($new_win_matches.count -le 10) {
#fail safe
$winnerswithurl = @()
foreach($winner in $winners){
foreach ($winner in $winners) {
$winnerswithurl += "[$winner](<https://dtch.online/latestmatches.php?selected_player=$($winner)>)"
}
send-discord -content ":chicken: :chicken: **WINNER WINNER CHICKEN DINNER!!** :chicken: :chicken:"

View file

@ -162,8 +162,11 @@ $last_month = (get-date).AddMonths($monthsback)
foreach ($file in $matchfiles) {
$json = get-content $file | ConvertFrom-Json
if($json.stats.matchType -eq 'event' -or $json.stats.gameMode -eq 'tdm'){
write-output 'match is event or tdm skipping'
if (
($stats.data.attributes.matchtype -eq 'event' -and $stats.data.attributes.gameMode -ne 'ibr') -or
($stats.data.attributes.gameMode -eq 'tdm')
) {
Write-Output 'Skipping because of event or tdm'
continue
}
if ($json.created -gt $last_month) {