Kullanıcılar
Kullanıcılar için REST API rotaları.
Botun kendisini getir (getCurrentBot)
GET https://noluyo.net/api/v1/users/@me (GET /users/@me)
Token'ın ait olduğu bot hesabını döndürür. Bot, herkese açık kullanıcı nesnesini alır; e-posta adresi yer almaz.
- Kimlik: Bot token'ı (
Authorization: Bot <BOT_TOKEN>) - Hız sınırı:
read(30 / 5s)
Örnek çağrılar
curl -X GET "https://noluyo.net/api/v1/users/@me" \
-H "Authorization: Bot $BOT_TOKEN"
// JavaScript (noluyo-bot)
await bot.rest.getCurrentBot();
# Python (noluyo_bot)
await bot.rest.get_current_bot()
Yanıt (200)
{
"id": "111540000000000001",
"username": "ornek_bot",
"display_name": "Örnek Bot",
"avatar": null,
"cosmetics": null,
"bot": true
}
Hata kodları
- HTTP 401:
unauthorized - HTTP 403:
temporarily_banned - HTTP 429:
rate_limited - HTTP 503:
maintenance
Botun bulunduğu sunucuları listele (listCurrentGuilds)
GET https://noluyo.net/api/v1/users/@me/guilds (GET /users/@me/guilds)
Çağıranın üyesi olduğu her sunucu için kısa bir nesne döndürür. Listede sayfalama yoktur.
- Kimlik: Bot token'ı (
Authorization: Bot <BOT_TOKEN>) - Hız sınırı:
read(30 / 5s)
Örnek çağrılar
curl -X GET "https://noluyo.net/api/v1/users/@me/guilds" \
-H "Authorization: Bot $BOT_TOKEN"
// JavaScript (noluyo-bot)
await bot.rest.listCurrentGuilds();
# Python (noluyo_bot)
await bot.rest.list_current_guilds()
Yanıt (200)
[
{
"id": "111500000000000000",
"name": "Örnek Sunucu",
"icon": null,
"owner": false,
"features": []
}
]
Hata kodları
- HTTP 401:
unauthorized - HTTP 403:
temporarily_banned - HTTP 429:
rate_limited - HTTP 503:
maintenance
Sunucudan ayrıl (leaveGuild)
DELETE https://noluyo.net/api/v1/users/@me/guilds/{guild_id} (DELETE /users/@me/guilds/{guild_id})
Çağıranı sunucudan çıkarır. Bot için, kendine ait yönetilen rol üyelikle birlikte silinir.
- Kimlik: Bot token'ı (
Authorization: Bot <BOT_TOKEN>) - Hız sınırı:
write(10 / 10s)
Parametreler
| Ad | Konum | Tür | Zorunlu | Açıklama |
|---|---|---|---|---|
guild_id | path | string | evet | Sunucu ID'si. |
Örnek çağrılar
curl -X DELETE "https://noluyo.net/api/v1/users/@me/guilds/111500000000000000" \
-H "Authorization: Bot $BOT_TOKEN"
// JavaScript (noluyo-bot)
await bot.rest.leaveGuild("111500000000000000");
# Python (noluyo_bot)
await bot.rest.leave_guild("111500000000000000")
Yanıt (204)
Yanıt gövdesi yok.
Hata kodları
- HTTP 400:
owner_cannot_leave - HTTP 401:
unauthorized - HTTP 403:
temporarily_banned - HTTP 404:
unknown_guild - HTTP 429:
rate_limited - HTTP 503:
maintenance