> For the complete documentation index, see [llms.txt](https://micup.renbow.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://micup.renbow.dev/mesaj-ve-rest-metotlari.md).

# Mesaj ve REST metotları

Bu metotlar `Bot` üzerinden çağrılır.

## Mesaj gönderme

```python
await bot.send_message(channel_id, "Merhaba")
await bot.send_message(channel_id, None, embeds=[{"type": "rich", "title": "Başlık"}])
await bot.send_message(channel_id, "Yanıt", reply_to=mesaj_id)
```

* `content` `None` olabilir, ama o zaman `embeds` gibi bir içerik vermelisin.
* `reply_to` verilirse mesaj o mesajın yanıtı olarak gider.
* Diğer alanlar (`embeds`, `attachments`, `flags`, `tts`, `allowed_mentions` vb.) `**fields` ile geçirilir.
* Varsayılan olarak `allowed_mentions` boştur. Bot `@everyone`, `@here` ve kullanıcı etiketleriyle kimseyi bildirim almaya zorlamaz.

## Diğer mesaj metotları

| Metot                                                                                | Dönüş           | Açıklama                                                                                                                            |
| ------------------------------------------------------------------------------------ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `await bot.edit_message(channel_id, message_id, content)`                            | `Message`       | Mesajı düzenler.                                                                                                                    |
| `await bot.delete_message(channel_id, message_id)`                                   | `None`          | Tek mesajı siler.                                                                                                                   |
| `await bot.bulk_delete(channel_id, message_ids)`                                     | `int`           | Toplu siler. 100'lük parçalar halinde çalışır, silinen sayıyı döner. Sadece sunucu kanallarında çalışır, `MANAGE_MESSAGES` gerekir. |
| `await bot.get_messages(channel_id, limit=50, before=None, after=None, around=None)` | `List[Message]` | Mesaj listesi. `limit` 1–100 arasına sıkıştırılır.                                                                                  |

## Kullanıcı

| Metot                         | Dönüş  | Açıklama           |
| ----------------------------- | ------ | ------------------ |
| `await bot.get_user(user_id)` | `User` | Kullanıcı bilgisi. |

## Ham REST

```python
await bot.rest("GET", "/guilds/123/members/456")
await bot.rest("PUT", "/guilds/123/members/456/roles/789")
await bot.rest("PATCH", "/guilds/123/members/456", {"communication_disabled_until": "2026-10-10T12:00:00Z"})
```

* Yol `/v1` öneki olmadan verilir, kütüphane otomatik ekler.
* Gövde (`body`) sözlük olarak verilir, JSON'a çevrilir.
* Dönen veri JSON olarak döner. 204 yanıtlarda `None`.
* Hata alırsan `MicupAPIError` fırlatılır.

Hız sınırında (429) sunucunun `retry_after` değeri kadar bekleyip otomatik yeniden dener.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://micup.renbow.dev/mesaj-ve-rest-metotlari.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
