# Komutlar

Botun sunduğu komutlar: eğik çizgi komutları, kullanıcı ve mesaj menüleri; global ya da bir sunucuya özel. Kişinin oturumu, sahibi olduğu uygulamalar için aynı rotalara ulaşır.

## Global komutları listele (`listGlobalCommands`)

**`GET https://noluyo.net/api/v1/applications/{application_id}/commands`** (`GET /applications/{application_id}/commands`)

Uygulamanın global komutlarını seçenekleriyle listeler. Global komutlar botun bulunduğu her sunucuda çalışır.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `read` (30 / 5s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |

### Örnek çağrılar

```bash
curl -X GET "https://noluyo.net/api/v1/applications/111540000000000000/commands" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.listGlobalCommands("111540000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.list_global_commands("111540000000000000")
```

### Yanıt (200)

```json
[
  {
    "id": "111560000000000000",
    "application_id": "111540000000000000",
    "version": "111560000000000001",
    "guild_id": null,
    "type": 1,
    "name": "selam",
    "name_localizations": {
      "en": "hello"
    },
    "description": "Birini selamlar",
    "description_localizations": {
      "en": "Greets someone"
    },
    "options": [
      {
        "type": 6,
        "name": "kisi",
        "name_localizations": {
          "en": "person"
        },
        "description": "Selamlanacak kişi",
        "description_localizations": {
          "en": "The person to greet"
        },
        "required": true
      }
    ],
    "default_member_permissions": null,
    "contexts": [
      0,
      1
    ]
  }
]
```

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `temporarily_banned`
- **HTTP 404:** `unknown_application`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Global komutların hepsini değiştir (`replaceGlobalCommands`)

**`PUT https://noluyo.net/api/v1/applications/{application_id}/commands`** (`PUT /applications/{application_id}/commands`)

Listeyi global komutlarının tamamı yapar, tek adımda. Türü ve adı eşleşen komutun kimliği kalır; listede olmayanlar silinir; boş liste hepsini siler. Bir tanım geçersizse hiçbir şey değişmez. Günlük sınıra yalnız yeni komutlar sayılır; bunu bot açılırken gönder. Global komutlar botun bulunduğu her sunucuda çalışır.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |

### Örnek çağrılar

```bash
curl -X PUT "https://noluyo.net/api/v1/applications/111540000000000000/commands" \
  -H "Authorization: Bot $BOT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"name":"selam","description":"Birini selamlar","options":[{"type":6,"name":"kisi","description":"Selamlanacak kişi","required":true}]},{"type":2,"name":"Profili aç"}]'
```

```js
// JavaScript (noluyo-bot)
await bot.rest.replaceGlobalCommands("111540000000000000", [{ name: "selam", description: "Birini selamlar", options: [{ type: 6, name: "kisi", description: "Selamlanacak kişi", required: true }] }, { type: 2, name: "Profili aç" }]);
```

```py
# Python (noluyo_bot)
await bot.rest.replace_global_commands("111540000000000000", [{"name": "selam", "description": "Birini selamlar", "options": [{"type": 6, "name": "kisi", "description": "Selamlanacak kişi", "required": True}]}, {"type": 2, "name": "Profili aç"}])
```

### Yanıt (200)

```json
[
  {
    "id": "111560000000000000",
    "application_id": "111540000000000000",
    "version": "111560000000000001",
    "guild_id": null,
    "type": 1,
    "name": "selam",
    "name_localizations": {
      "en": "hello"
    },
    "description": "Birini selamlar",
    "description_localizations": {
      "en": "Greets someone"
    },
    "options": [
      {
        "type": 6,
        "name": "kisi",
        "name_localizations": {
          "en": "person"
        },
        "description": "Selamlanacak kişi",
        "description_localizations": {
          "en": "The person to greet"
        },
        "required": true
      }
    ],
    "default_member_permissions": null,
    "contexts": [
      0,
      1
    ]
  }
]
```

### Hata kodları

- **HTTP 400:** `validation_failed`, `invalid_body`, `max_commands`
- **HTTP 401:** `unauthorized`
- **HTTP 403:** `temporarily_banned`
- **HTTP 404:** `unknown_application`
- **HTTP 413:** `body_too_large`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Global komutu oluştur (`createGlobalCommand`)

**`POST https://noluyo.net/api/v1/applications/{application_id}/commands`** (`POST /applications/{application_id}/commands`)

Komut ekler. Aynı tür ve adda komut varsa tanımı değişir, kimliği kalır: 201 yerine 200 döner. Yeni komut, kapsam başına günde 200 yeni komuta sayılır; güncelleme sayılmaz. Kişiler değişikliği en geç 60 saniyede görür. Global komutlar botun bulunduğu her sunucuda çalışır.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |

### Gövde alanları

| Alan | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- |
| `type` | `integer` | - | 1 eğik çizgi komutu (varsayılan), 2 kullanıcı menüsü, 3 mesaj menüsü. (1, 2, 3) |
| `name` | `string` | evet | Eğik çizgi komutu: küçük harf, rakam, - ve _. Menü: en çok 32 karakter, boşluk ve büyük harf olabilir. (1–32) |
| `name_localizations` | `object` | - | Adın tr ve en karşılığı. |
| `description` | `string` | - | Eğik çizgi komutunda zorunlu, menüde boş. (<= 100) |
| `description_localizations` | `object` | - | Açıklamanın tr ve en karşılığı. |
| `options` | `CommandOption[]` | - | Yalnız eğik çizgi komutunda. (<= 25) |
| `default_member_permissions` | `permissions | null` | - | Sunucu kural koyana dek kimin kullanacağı: null herkes, "0" yalnız sahip ve yöneticiler, değilse bu bitlerin hepsine sahip üyeler. |
| `contexts` | `integer[]` | - | Nerede çalıştığı: 0 sunucu kanalı, 1 kişinin botunla açtığı DM. Gönderilmezse [0, 1]. Her biri en çok bir kez. default_member_permissions dolu komut bu ne derse desin DM'de çalışmaz: orada kimsenin izin biti yok. (1–2) |

### Örnek çağrılar

```bash
curl -X POST "https://noluyo.net/api/v1/applications/111540000000000000/commands" \
  -H "Authorization: Bot $BOT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"selam","description":"Birini selamlar","options":[{"type":6,"name":"kisi","description":"Selamlanacak kişi","required":true}]}'
```

```js
// JavaScript (noluyo-bot)
await bot.rest.createGlobalCommand("111540000000000000", { name: "selam", description: "Birini selamlar", options: [{ type: 6, name: "kisi", description: "Selamlanacak kişi", required: true }] });
```

```py
# Python (noluyo_bot)
await bot.rest.create_global_command("111540000000000000", {"name": "selam", "description": "Birini selamlar", "options": [{"type": 6, "name": "kisi", "description": "Selamlanacak kişi", "required": True}]})
```

### Yanıt (200)

```json
{
  "id": "111560000000000000",
  "application_id": "111540000000000000",
  "version": "111560000000000001",
  "guild_id": null,
  "type": 1,
  "name": "selam",
  "name_localizations": {
    "en": "hello"
  },
  "description": "Birini selamlar",
  "description_localizations": {
    "en": "Greets someone"
  },
  "options": [
    {
      "type": 6,
      "name": "kisi",
      "name_localizations": {
        "en": "person"
      },
      "description": "Selamlanacak kişi",
      "description_localizations": {
        "en": "The person to greet"
      },
      "required": true
    }
  ],
  "default_member_permissions": null,
  "contexts": [
    0,
    1
  ]
}
```

### Hata kodları

- **HTTP 400:** `validation_failed`, `invalid_body`, `max_commands`
- **HTTP 401:** `unauthorized`
- **HTTP 403:** `temporarily_banned`
- **HTTP 404:** `unknown_application`
- **HTTP 413:** `body_too_large`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Global komutu getir (`getGlobalCommand`)

**`GET https://noluyo.net/api/v1/applications/{application_id}/commands/{command_id}`** (`GET /applications/{application_id}/commands/{command_id}`)

Global komutlarından birini döner. Global komutlar botun bulunduğu her sunucuda çalışır.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `read` (30 / 5s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `command_id` | `path` | `string` | evet | Komut ID'si. |

### Örnek çağrılar

```bash
curl -X GET "https://noluyo.net/api/v1/applications/111540000000000000/commands/111560000000000000" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.getGlobalCommand("111540000000000000", "111560000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.get_global_command("111540000000000000", "111560000000000000")
```

### Yanıt (200)

```json
{
  "id": "111560000000000000",
  "application_id": "111540000000000000",
  "version": "111560000000000001",
  "guild_id": null,
  "type": 1,
  "name": "selam",
  "name_localizations": {
    "en": "hello"
  },
  "description": "Birini selamlar",
  "description_localizations": {
    "en": "Greets someone"
  },
  "options": [
    {
      "type": 6,
      "name": "kisi",
      "name_localizations": {
        "en": "person"
      },
      "description": "Selamlanacak kişi",
      "description_localizations": {
        "en": "The person to greet"
      },
      "required": true
    }
  ],
  "default_member_permissions": null,
  "contexts": [
    0,
    1
  ]
}
```

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `temporarily_banned`
- **HTTP 404:** `unknown_application`, `unknown_command`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Global komutu düzenle (`editGlobalCommand`)

**`PATCH https://noluyo.net/api/v1/applications/{application_id}/commands/{command_id}`** (`PATCH /applications/{application_id}/commands/{command_id}`)

Gönderilen alanları değiştirir, diğerleri kalır. type değişmez: komutu silip yeniden oluştur. version değişir. Global komutlar botun bulunduğu her sunucuda çalışır.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `command_id` | `path` | `string` | evet | Komut ID'si. |

### Gövde alanları

| Alan | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- |
| `type` | `integer` | - | 1 eğik çizgi komutu (varsayılan), 2 kullanıcı menüsü, 3 mesaj menüsü. (1, 2, 3) |
| `name` | `string` | evet | Eğik çizgi komutu: küçük harf, rakam, - ve _. Menü: en çok 32 karakter, boşluk ve büyük harf olabilir. (1–32) |
| `name_localizations` | `object` | - | Adın tr ve en karşılığı. |
| `description` | `string` | - | Eğik çizgi komutunda zorunlu, menüde boş. (<= 100) |
| `description_localizations` | `object` | - | Açıklamanın tr ve en karşılığı. |
| `options` | `CommandOption[]` | - | Yalnız eğik çizgi komutunda. (<= 25) |
| `default_member_permissions` | `permissions | null` | - | Sunucu kural koyana dek kimin kullanacağı: null herkes, "0" yalnız sahip ve yöneticiler, değilse bu bitlerin hepsine sahip üyeler. |
| `contexts` | `integer[]` | - | Nerede çalıştığı: 0 sunucu kanalı, 1 kişinin botunla açtığı DM. Gönderilmezse [0, 1]. Her biri en çok bir kez. default_member_permissions dolu komut bu ne derse desin DM'de çalışmaz: orada kimsenin izin biti yok. (1–2) |

### Örnek çağrılar

```bash
curl -X PATCH "https://noluyo.net/api/v1/applications/111540000000000000/commands/111560000000000000" \
  -H "Authorization: Bot $BOT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"description":"Birine merhaba der"}'
```

```js
// JavaScript (noluyo-bot)
await bot.rest.editGlobalCommand("111540000000000000", "111560000000000000", { description: "Birine merhaba der" });
```

```py
# Python (noluyo_bot)
await bot.rest.edit_global_command("111540000000000000", "111560000000000000", {"description": "Birine merhaba der"})
```

### Yanıt (200)

```json
{
  "id": "111560000000000000",
  "application_id": "111540000000000000",
  "version": "111560000000000001",
  "guild_id": null,
  "type": 1,
  "name": "selam",
  "name_localizations": {
    "en": "hello"
  },
  "description": "Birini selamlar",
  "description_localizations": {
    "en": "Greets someone"
  },
  "options": [
    {
      "type": 6,
      "name": "kisi",
      "name_localizations": {
        "en": "person"
      },
      "description": "Selamlanacak kişi",
      "description_localizations": {
        "en": "The person to greet"
      },
      "required": true
    }
  ],
  "default_member_permissions": null,
  "contexts": [
    0,
    1
  ]
}
```

### Hata kodları

- **HTTP 400:** `validation_failed`, `invalid_body`
- **HTTP 401:** `unauthorized`
- **HTTP 403:** `temporarily_banned`
- **HTTP 404:** `unknown_application`, `unknown_command`
- **HTTP 413:** `body_too_large`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Global komutu sil (`deleteGlobalCommand`)

**`DELETE https://noluyo.net/api/v1/applications/{application_id}/commands/{command_id}`** (`DELETE /applications/{application_id}/commands/{command_id}`)

Global komutlarından birini izin kurallarıyla siler. Global komutlar botun bulunduğu her sunucuda çalışır.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `command_id` | `path` | `string` | evet | Komut ID'si. |

### Örnek çağrılar

```bash
curl -X DELETE "https://noluyo.net/api/v1/applications/111540000000000000/commands/111560000000000000" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.deleteGlobalCommand("111540000000000000", "111560000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.delete_global_command("111540000000000000", "111560000000000000")
```

### Yanıt (204)

Yanıt gövdesi yok.

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `temporarily_banned`
- **HTTP 404:** `unknown_application`, `unknown_command`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Sunucu komutlarını listele (`listGuildCommands`)

**`GET https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands`** (`GET /applications/{application_id}/guilds/{guild_id}/commands`)

Uygulamanın bu sunucunun komutlarını seçenekleriyle listeler. Botun bir sunucuya özel komutları. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `read` (30 / 5s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |

### Örnek çağrılar

```bash
curl -X GET "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.listGuildCommands("111540000000000000", "111500000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.list_guild_commands("111540000000000000", "111500000000000000")
```

### Yanıt (200)

```json
[
  {
    "id": "111560000000000000",
    "application_id": "111540000000000000",
    "version": "111560000000000001",
    "guild_id": "111500000000000000",
    "type": 1,
    "name": "selam",
    "name_localizations": {
      "en": "hello"
    },
    "description": "Birini selamlar",
    "description_localizations": {
      "en": "Greets someone"
    },
    "options": [
      {
        "type": 6,
        "name": "kisi",
        "name_localizations": {
          "en": "person"
        },
        "description": "Selamlanacak kişi",
        "description_localizations": {
          "en": "The person to greet"
        },
        "required": true
      }
    ],
    "default_member_permissions": null,
    "contexts": [
      0,
      1
    ]
  }
]
```

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Sunucu komutlarının hepsini değiştir (`replaceGuildCommands`)

**`PUT https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands`** (`PUT /applications/{application_id}/guilds/{guild_id}/commands`)

Listeyi bu sunucunun komutlarının tamamı yapar, tek adımda. Türü ve adı eşleşen komutun kimliği kalır; listede olmayanlar silinir; boş liste hepsini siler. Bir tanım geçersizse hiçbir şey değişmez. Günlük sınıra yalnız yeni komutlar sayılır; bunu bot açılırken gönder. Botun bir sunucuya özel komutları. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |

### Örnek çağrılar

```bash
curl -X PUT "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands" \
  -H "Authorization: Bot $BOT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '[{"name":"selam","description":"Birini selamlar","options":[{"type":6,"name":"kisi","description":"Selamlanacak kişi","required":true}]},{"type":2,"name":"Profili aç"}]'
```

```js
// JavaScript (noluyo-bot)
await bot.rest.replaceGuildCommands("111540000000000000", "111500000000000000", [{ name: "selam", description: "Birini selamlar", options: [{ type: 6, name: "kisi", description: "Selamlanacak kişi", required: true }] }, { type: 2, name: "Profili aç" }]);
```

```py
# Python (noluyo_bot)
await bot.rest.replace_guild_commands("111540000000000000", "111500000000000000", [{"name": "selam", "description": "Birini selamlar", "options": [{"type": 6, "name": "kisi", "description": "Selamlanacak kişi", "required": True}]}, {"type": 2, "name": "Profili aç"}])
```

### Yanıt (200)

```json
[
  {
    "id": "111560000000000000",
    "application_id": "111540000000000000",
    "version": "111560000000000001",
    "guild_id": "111500000000000000",
    "type": 1,
    "name": "selam",
    "name_localizations": {
      "en": "hello"
    },
    "description": "Birini selamlar",
    "description_localizations": {
      "en": "Greets someone"
    },
    "options": [
      {
        "type": 6,
        "name": "kisi",
        "name_localizations": {
          "en": "person"
        },
        "description": "Selamlanacak kişi",
        "description_localizations": {
          "en": "The person to greet"
        },
        "required": true
      }
    ],
    "default_member_permissions": null,
    "contexts": [
      0,
      1
    ]
  }
]
```

### Hata kodları

- **HTTP 400:** `validation_failed`, `invalid_body`, `max_commands`
- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`
- **HTTP 413:** `body_too_large`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Sunucu komutu oluştur (`createGuildCommand`)

**`POST https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands`** (`POST /applications/{application_id}/guilds/{guild_id}/commands`)

Komut ekler. Aynı tür ve adda komut varsa tanımı değişir, kimliği kalır: 201 yerine 200 döner. Yeni komut, kapsam başına günde 200 yeni komuta sayılır; güncelleme sayılmaz. Kişiler değişikliği en geç 60 saniyede görür. Botun bir sunucuya özel komutları. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |

### Gövde alanları

| Alan | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- |
| `type` | `integer` | - | 1 eğik çizgi komutu (varsayılan), 2 kullanıcı menüsü, 3 mesaj menüsü. (1, 2, 3) |
| `name` | `string` | evet | Eğik çizgi komutu: küçük harf, rakam, - ve _. Menü: en çok 32 karakter, boşluk ve büyük harf olabilir. (1–32) |
| `name_localizations` | `object` | - | Adın tr ve en karşılığı. |
| `description` | `string` | - | Eğik çizgi komutunda zorunlu, menüde boş. (<= 100) |
| `description_localizations` | `object` | - | Açıklamanın tr ve en karşılığı. |
| `options` | `CommandOption[]` | - | Yalnız eğik çizgi komutunda. (<= 25) |
| `default_member_permissions` | `permissions | null` | - | Sunucu kural koyana dek kimin kullanacağı: null herkes, "0" yalnız sahip ve yöneticiler, değilse bu bitlerin hepsine sahip üyeler. |
| `contexts` | `integer[]` | - | Nerede çalıştığı: 0 sunucu kanalı, 1 kişinin botunla açtığı DM. Gönderilmezse [0, 1]. Her biri en çok bir kez. default_member_permissions dolu komut bu ne derse desin DM'de çalışmaz: orada kimsenin izin biti yok. (1–2) |

### Örnek çağrılar

```bash
curl -X POST "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands" \
  -H "Authorization: Bot $BOT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"selam","description":"Birini selamlar","options":[{"type":6,"name":"kisi","description":"Selamlanacak kişi","required":true}]}'
```

```js
// JavaScript (noluyo-bot)
await bot.rest.createGuildCommand("111540000000000000", "111500000000000000", { name: "selam", description: "Birini selamlar", options: [{ type: 6, name: "kisi", description: "Selamlanacak kişi", required: true }] });
```

```py
# Python (noluyo_bot)
await bot.rest.create_guild_command("111540000000000000", "111500000000000000", {"name": "selam", "description": "Birini selamlar", "options": [{"type": 6, "name": "kisi", "description": "Selamlanacak kişi", "required": True}]})
```

### Yanıt (200)

```json
{
  "id": "111560000000000000",
  "application_id": "111540000000000000",
  "version": "111560000000000001",
  "guild_id": "111500000000000000",
  "type": 1,
  "name": "selam",
  "name_localizations": {
    "en": "hello"
  },
  "description": "Birini selamlar",
  "description_localizations": {
    "en": "Greets someone"
  },
  "options": [
    {
      "type": 6,
      "name": "kisi",
      "name_localizations": {
        "en": "person"
      },
      "description": "Selamlanacak kişi",
      "description_localizations": {
        "en": "The person to greet"
      },
      "required": true
    }
  ],
  "default_member_permissions": null,
  "contexts": [
    0,
    1
  ]
}
```

### Hata kodları

- **HTTP 400:** `validation_failed`, `invalid_body`, `max_commands`
- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`
- **HTTP 413:** `body_too_large`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Sunucu komutunu getir (`getGuildCommand`)

**`GET https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands/{command_id}`** (`GET /applications/{application_id}/guilds/{guild_id}/commands/{command_id}`)

Bu sunucunun komutlarından birini döner. Botun bir sunucuya özel komutları. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `read` (30 / 5s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |
| `command_id` | `path` | `string` | evet | Komut ID'si. |

### Örnek çağrılar

```bash
curl -X GET "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands/111560000000000000" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.getGuildCommand("111540000000000000", "111500000000000000", "111560000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.get_guild_command("111540000000000000", "111500000000000000", "111560000000000000")
```

### Yanıt (200)

```json
{
  "id": "111560000000000000",
  "application_id": "111540000000000000",
  "version": "111560000000000001",
  "guild_id": "111500000000000000",
  "type": 1,
  "name": "selam",
  "name_localizations": {
    "en": "hello"
  },
  "description": "Birini selamlar",
  "description_localizations": {
    "en": "Greets someone"
  },
  "options": [
    {
      "type": 6,
      "name": "kisi",
      "name_localizations": {
        "en": "person"
      },
      "description": "Selamlanacak kişi",
      "description_localizations": {
        "en": "The person to greet"
      },
      "required": true
    }
  ],
  "default_member_permissions": null,
  "contexts": [
    0,
    1
  ]
}
```

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`, `unknown_command`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Sunucu komutunu düzenle (`editGuildCommand`)

**`PATCH https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands/{command_id}`** (`PATCH /applications/{application_id}/guilds/{guild_id}/commands/{command_id}`)

Gönderilen alanları değiştirir, diğerleri kalır. type değişmez: komutu silip yeniden oluştur. version değişir. Botun bir sunucuya özel komutları. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |
| `command_id` | `path` | `string` | evet | Komut ID'si. |

### Gövde alanları

| Alan | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- |
| `type` | `integer` | - | 1 eğik çizgi komutu (varsayılan), 2 kullanıcı menüsü, 3 mesaj menüsü. (1, 2, 3) |
| `name` | `string` | evet | Eğik çizgi komutu: küçük harf, rakam, - ve _. Menü: en çok 32 karakter, boşluk ve büyük harf olabilir. (1–32) |
| `name_localizations` | `object` | - | Adın tr ve en karşılığı. |
| `description` | `string` | - | Eğik çizgi komutunda zorunlu, menüde boş. (<= 100) |
| `description_localizations` | `object` | - | Açıklamanın tr ve en karşılığı. |
| `options` | `CommandOption[]` | - | Yalnız eğik çizgi komutunda. (<= 25) |
| `default_member_permissions` | `permissions | null` | - | Sunucu kural koyana dek kimin kullanacağı: null herkes, "0" yalnız sahip ve yöneticiler, değilse bu bitlerin hepsine sahip üyeler. |
| `contexts` | `integer[]` | - | Nerede çalıştığı: 0 sunucu kanalı, 1 kişinin botunla açtığı DM. Gönderilmezse [0, 1]. Her biri en çok bir kez. default_member_permissions dolu komut bu ne derse desin DM'de çalışmaz: orada kimsenin izin biti yok. (1–2) |

### Örnek çağrılar

```bash
curl -X PATCH "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands/111560000000000000" \
  -H "Authorization: Bot $BOT_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"description":"Birine merhaba der"}'
```

```js
// JavaScript (noluyo-bot)
await bot.rest.editGuildCommand("111540000000000000", "111500000000000000", "111560000000000000", { description: "Birine merhaba der" });
```

```py
# Python (noluyo_bot)
await bot.rest.edit_guild_command("111540000000000000", "111500000000000000", "111560000000000000", {"description": "Birine merhaba der"})
```

### Yanıt (200)

```json
{
  "id": "111560000000000000",
  "application_id": "111540000000000000",
  "version": "111560000000000001",
  "guild_id": "111500000000000000",
  "type": 1,
  "name": "selam",
  "name_localizations": {
    "en": "hello"
  },
  "description": "Birini selamlar",
  "description_localizations": {
    "en": "Greets someone"
  },
  "options": [
    {
      "type": 6,
      "name": "kisi",
      "name_localizations": {
        "en": "person"
      },
      "description": "Selamlanacak kişi",
      "description_localizations": {
        "en": "The person to greet"
      },
      "required": true
    }
  ],
  "default_member_permissions": null,
  "contexts": [
    0,
    1
  ]
}
```

### Hata kodları

- **HTTP 400:** `validation_failed`, `invalid_body`
- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`, `unknown_command`
- **HTTP 413:** `body_too_large`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Sunucu komutunu sil (`deleteGuildCommand`)

**`DELETE https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands/{command_id}`** (`DELETE /applications/{application_id}/guilds/{guild_id}/commands/{command_id}`)

Bu sunucunun komutlarından birini izin kurallarıyla siler. Botun bir sunucuya özel komutları. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `command` (5 / 20s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |
| `command_id` | `path` | `string` | evet | Komut ID'si. |

### Örnek çağrılar

```bash
curl -X DELETE "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands/111560000000000000" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.deleteGuildCommand("111540000000000000", "111500000000000000", "111560000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.delete_guild_command("111540000000000000", "111500000000000000", "111560000000000000")
```

### Yanıt (204)

Yanıt gövdesi yok.

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`, `unknown_command`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Sunucudaki komut kurallarını listele (`listCommandPermissions`)

**`GET https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands/permissions`** (`GET /applications/{application_id}/guilds/{guild_id}/commands/permissions`)

Bu botun komutları için bir sunucuda konmuş her kural: kuralı olan her komut için bir kayıt, tüm komutlarının kuralları için uygulamanın ID'siyle bir kayıt. Kuralı olmayan komut listede yer almaz. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur. Kuralları yalnızca sunucu yöneticileri N'oluyo'da yazar; bot okur ve değişince APPLICATION_COMMAND_PERMISSIONS_UPDATE alır. Sunucu kuralları zaten uygular: kişinin kullanamayacağı komut ona gösterilmez ve çalışmaz.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `read` (30 / 5s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |

### Örnek çağrılar

```bash
curl -X GET "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands/permissions" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.listCommandPermissions("111540000000000000", "111500000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.list_command_permissions("111540000000000000", "111500000000000000")
```

### Yanıt (200)

```json
[
  {
    "id": "111540000000000000",
    "application_id": "111540000000000000",
    "guild_id": "111500000000000000",
    "permissions": [
      {
        "type": 1,
        "id": "111500000000000000",
        "allow": false
      }
    ]
  },
  {
    "id": "111560000000000000",
    "application_id": "111540000000000000",
    "guild_id": "111500000000000000",
    "permissions": [
      {
        "type": 1,
        "id": "111520000000000000",
        "allow": true
      },
      {
        "type": 3,
        "id": "0",
        "allow": false
      },
      {
        "type": 3,
        "id": "111510000000000000",
        "allow": true
      }
    ]
  }
]
```

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`

## Komutun kurallarını getir (`getCommandPermissions`)

**`GET https://noluyo.net/api/v1/applications/{application_id}/guilds/{guild_id}/commands/{command_id}/permissions`** (`GET /applications/{application_id}/guilds/{guild_id}/commands/{command_id}/permissions`)

Bir komutun bir sunucudaki kuralları: global komut ya da bu sunucunun komutu. Kural yoksa liste boştur. Tüm komutların kuralları (uygulamanın ID'siyle olan kayıt) burada yer almaz; onları yukarıdaki rotayla listele. Bot o sunucuda üye olmalı; değilse yanıt missing_access olur. Kuralları yalnızca sunucu yöneticileri N'oluyo'da yazar; bot okur ve değişince APPLICATION_COMMAND_PERMISSIONS_UPDATE alır. Sunucu kuralları zaten uygular: kişinin kullanamayacağı komut ona gösterilmez ve çalışmaz.

- **Kimlik:** Bot token'ı (`Authorization: Bot <BOT_TOKEN>`)
- **Hız sınırı:** `read` (30 / 5s)

### Parametreler

| Ad | Konum | Tür | Zorunlu | Açıklama |
| --- | --- | --- | --- | --- |
| `application_id` | `path` | `string` | evet | Uygulama ID'si. |
| `guild_id` | `path` | `string` | evet | Sunucu ID'si. |

### Örnek çağrılar

```bash
curl -X GET "https://noluyo.net/api/v1/applications/111540000000000000/guilds/111500000000000000/commands/111560000000000000/permissions" \
  -H "Authorization: Bot $BOT_TOKEN"
```

```js
// JavaScript (noluyo-bot)
await bot.rest.getCommandPermissions("111540000000000000", "111500000000000000", "111560000000000000");
```

```py
# Python (noluyo_bot)
await bot.rest.get_command_permissions("111540000000000000", "111500000000000000", "111560000000000000")
```

### Yanıt (200)

```json
{
  "id": "111560000000000000",
  "application_id": "111540000000000000",
  "guild_id": "111500000000000000",
  "permissions": [
    {
      "type": 1,
      "id": "111520000000000000",
      "allow": true
    },
    {
      "type": 3,
      "id": "0",
      "allow": false
    },
    {
      "type": 3,
      "id": "111510000000000000",
      "allow": true
    }
  ]
}
```

### Hata kodları

- **HTTP 401:** `unauthorized`
- **HTTP 403:** `missing_access`, `temporarily_banned`
- **HTTP 404:** `unknown_application`, `unknown_command`
- **HTTP 429:** `rate_limited`
- **HTTP 503:** `maintenance`
