<commit_before># Taken from: https://github.com/DiscordHooks/appveyor-discord-webhook
# License: MIT

$STATUS=$args[0]
$WEBHOOK_URL=$args[1]

if (!$WEBHOOK_URL) {
  Write-Output "WARNING!!"
  Write-Output "You need to pass the WEBHOOK_URL environment variable as the second argument to this script."
  Exit
}

$AVATAR="https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Appveyor_logo.svg/256px-Appveyor_logo.svg.png"
$GITHUB_LOGO="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png"
$LMP_LOGO="https://raw.githubusercontent.com/LunaMultiplayer/LunaMultiplayer/master/External/Logos/RedFont/LMP_Icon_Medium.png"

$REPO_URL="https://github.com/$env:APPVEYOR_REPO_NAME/"
$URL="https://ci.appveyor.com/project/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_NAME"

$ARTIFACTS_URL="https://ci.appveyor.com/project/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_NAME/artifacts"
$CLIENT_URL="https://ci.appveyor.com/api/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/LunaMultiplayer-Debug.zip"
$MASTER_SERVER_URL="https://ci.appveyor.com/api/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/LunaMultiplayerMasterServer-Debug.zip"
$BUILD_VERSION = [uri]::EscapeDataString($env:APPVEYOR_BUILD_VERSION)
$TIMESTAMP="$(Get-Date -format s)Z"

Switch ($STATUS) {
  "success" {
    $EMBED_COLOR=3066993
    $STATUS_MESSAGE="Passed"
    Break
  }
  "failure" {
    $EMBED_COLOR=15158332
    $STATUS_MESSAGE="Failed"
    Break
  }
  default {
    Write-Output "Default!"
    Break
  }
}

$WEBHOOK_DATA="{
  ""username"": """",
  ""avatar_url"": ""$AVATAR"",
  ""content"":"""",
  ""embeds"": [ {
    ""color"": $EMBED_COLOR,
    ""author"": {
      ""name"": ""Appveyor nightly build"",
      ""url"": ""$URL"",
      ""icon_url"": ""$AVATAR""
    },
    ""title"": ""New nightly build available for download - $BUILD_VERSION"",
    ""url"": ""$ARTIFACTS_URL"",
    ""description"": ""Keep in mind that nightly builds might contain bugs!"",
    ""fields"": [
      {
        ""name"": ""Client"",
        ""value"": ""[Download Link]($CLIENT_URL)""
      },
      {
        ""name"": ""Master Server"",
        ""value"": ""[Download Link]($MASTER_SERVER_URL)""
      }
    ],
    ""timestamp"": ""$TIMESTAMP"",
    ""footer"": {
      ""icon_url"": ""$LMP_LOGO"",
      ""text"": ""Luna multiplayer""
    }
  } ]
}"

Write-Output "[Webhook]: Webhook payload data: $WEBHOOK_DATA"

Invoke-RestMethod -Uri "$WEBHOOK_URL" -Method POST -UserAgent "AppVeyor-Webhook" -ContentType "application/json" -Header @{"X-Autho" = "Dagger"} -Body $WEBHOOK_DATA

Write-Output "[Webhook]: Successfully sent the webhook."<commit_msg>Do not display master server<commit_after># Taken from: https://github.com/DiscordHooks/appveyor-discord-webhook
# License: MIT

$STATUS=$args[0]
$WEBHOOK_URL=$args[1]

if (!$WEBHOOK_URL) {
  Write-Output "WARNING!!"
  Write-Output "You need to pass the WEBHOOK_URL environment variable as the second argument to this script."
  Exit
}

$AVATAR="https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/Appveyor_logo.svg/256px-Appveyor_logo.svg.png"
$GITHUB_LOGO="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png"
$LMP_LOGO="https://raw.githubusercontent.com/LunaMultiplayer/LunaMultiplayer/master/External/Logos/RedFont/LMP_Icon_Medium.png"

$REPO_URL="https://github.com/$env:APPVEYOR_REPO_NAME/"
$URL="https://ci.appveyor.com/project/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_NAME"

$ARTIFACTS_URL="https://ci.appveyor.com/project/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_NAME/artifacts"
$CLIENT_URL="https://ci.appveyor.com/api/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/LunaMultiplayer-Debug.zip"
$MASTER_SERVER_URL="https://ci.appveyor.com/api/buildjobs/$env:APPVEYOR_JOB_ID/artifacts/LunaMultiplayerMasterServer-Debug.zip"
$BUILD_VERSION = [uri]::EscapeDataString($env:APPVEYOR_BUILD_VERSION)
$TIMESTAMP="$(Get-Date -format s)Z"

Switch ($STATUS) {
  "success" {
    $EMBED_COLOR=3066993
    $STATUS_MESSAGE="Passed"
    Break
  }
  "failure" {
    $EMBED_COLOR=15158332
    $STATUS_MESSAGE="Failed"
    Break
  }
  default {
    Write-Output "Default!"
    Break
  }
}

$WEBHOOK_DATA="{
  ""username"": """",
  ""avatar_url"": ""$AVATAR"",
  ""content"":"""",
  ""embeds"": [ {
    ""color"": $EMBED_COLOR,
    ""author"": {
      ""name"": ""Appveyor nightly build"",
      ""url"": ""$URL"",
      ""icon_url"": ""$AVATAR""
    },
    ""title"": ""New nightly build available for download - $BUILD_VERSION"",
    ""url"": ""$ARTIFACTS_URL"",
    ""description"": ""Keep in mind that nightly builds might contain bugs!"",
    ""fields"": [
      {
        ""name"": ""Client"",
        ""value"": ""[Download Link]($CLIENT_URL)""
      }
    ],
    ""timestamp"": ""$TIMESTAMP"",
    ""footer"": {
      ""icon_url"": ""$LMP_LOGO"",
      ""text"": ""Luna multiplayer""
    }
  } ]
}"

Write-Output "[Webhook]: Webhook payload data: $WEBHOOK_DATA"

Invoke-RestMethod -Uri "$WEBHOOK_URL" -Method POST -UserAgent "AppVeyor-Webhook" -ContentType "application/json" -Header @{"X-Autho" = "Dagger"} -Body $WEBHOOK_DATA

Write-Output "[Webhook]: Successfully sent the webhook."
{'fraction_non_alphanumeric': 0.1856975837879969, 'fraction_numerical': 0.00779423226812159, 'mean_word_length': 4.585418933623504, 'pattern_counts': {'":': 40, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3349838', 'n_tokens_mistral': 2002, 'n_tokens_neox': 1963, 'n_words': 275}