> For the complete documentation index, see [llms.txt](https://kucluck.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kucluck.gitbook.io/docs/utils/kc-logger/tips.md).

# Tips

### How to get Webhook URL

1. Go to the discord channel you want to get the webhook from and click on the gear image next to the channel name.

<figure><img src="/files/qIQiQxoUFRNf1cPIqmra" alt=""><figcaption></figcaption></figure>

2. Then choose Integrations and select Create Webhooks

<figure><img src="/files/v5FoyKyJv6dtfjtu5DhU" alt=""><figcaption></figcaption></figure>

3. Then click Copy Webhook URL

<figure><img src="/files/8XonW7t5MnOyE7914hX2" alt=""><figcaption></figcaption></figure>

### How To Use Logger

example for leave logger

```lua
function ExtractIdentifiers(id, _type)
  local identifiers = {
    steam = "",
    ip = "",
    discord = "",
    license = "",
    xbl = "",
    live = ""
  }

  for i = 0, GetNumPlayerIdentifiers(id) - 1 do
    local playerID = GetPlayerIdentifier(id, i)
    if string.find(playerID, "steam") then
      identifiers.steam = playerID
    elseif string.find(playerID, "ip") then
      identifiers.ip = playerID
    elseif string.find(playerID, "discord") then
      identifiers.discord = playerID
    elseif string.find(playerID, "license") then
      identifiers.license = playerID
    elseif string.find(playerID, "xbl") then
      identifiers.xbl = playerID
    elseif string.find(playerID, "live") then
      identifiers.live = playerID
    end
  end

  if _type then
    return identifiers[_type]
  else
    return identifiers
  end
end

AddEventHandler("playerDropped", function(reason)
  local src = source
  local identifiers = ExtractIdentifiers(src, false)
  local discordId = identifiers.discord:gsub("discord:", "")
  local coords = GetEntityCoords(GetPlayerPed(src))

  exports['kc_logger']:DiscordLog({
    webhook = Config.PlayerLeave, 
    title = '📤 Leave',
    embeds = '**'..GetPlayerName(src)..'** Baru saja meninggalkan kota.\n**Reason: **`'..reason..'`\n**Coordinat:** `'..coords..'`\n\n`👥` **Nama: '..GetPlayerName(src)..'**\n`🔢` **Server ID:** `'..src..'`\n`💬` **Discord:** <@'..discordId..'> (||'..discordId..'||)\n`🎮` **Steam Hex: **`'..identifiers['steam']..'`',
    color = '#F23A3A'
  })
end)
```
