Geliştirici paneli inkiveta.com

Hata kodları

Her yanıt Telegram biçimindedir; HTTP durum kodu error_code ile aynıdır:

json{"ok":false,"error_code":400,"description":"Bad Request: chat not found"}
KodNe zamanNe yapmalı
400 Bad Request: …Parametre hatasıdescription'ı oku, isteği düzelt; tekrar deneme
401 UnauthorizedToken yanlış ya da yenilenmiş, uygulama silinmiş, ya da /test/ yolunda gerçek tokenAtölye → Anahtar'dan doğru token'ı al
403 Forbidden: …Kullanıcıya yazamıyorsunKurallar — kullanıcıyı hemen silme
404 Not FoundBilinmeyen yöntem ya da bozuk yol / token biçimiYöntem adını ve adresi denetle
409 Conflict: …Webhook / yoklama / akış çakışmasıGüncellemeleri almak
429 Too Many Requests: retry after NHız sınırıretry_after saniye bekle, sonra tekrar dene
500 Internal Server ErrorSunucu hatasıKısa bir bekleyişten sonra tekrar dene
503 Service UnavailableBakımBekleyip tekrar dene

İpucu: Kodunda hata metnine göre dallanacaksan önce error_code'a bak. Aşağıdaki "Telegram ile aynı" metinlere güvenebilirsin; geri kalanların ifadesi ileride değişebilir.

Telegram ile birebir aynı metinler#

Bu metinler Telegram'ın kendi sunucusundakiyle aynıdır; kütüphanelerin hata eşlemesi (ör. python-telegram-bot BadRequest, Forbidden) bu yüzden olduğu gibi çalışır:

chat not found · message to edit not found · message is not modified: … · message can't be edited · message identifier is not specified · BUTTON_TYPE_INVALID · BUTTON_DATA_INVALID · BUTTON_URL_INVALID · query is too old and response timeout expired or query ID is invalid · rich message must be non-empty · object expected as rich message · message to set game score not found · message to get game high scores not found · message with widget to edit not found · expected InputPollOption to be an Object · unsupported poll type specified · can't parse options JSON object · message with poll to stop not found · can't parse entities: …

Hata vermek yerine kırpılan değerler: open_period 0–2.628.000, cache_time 0–2.592.000, max_connections 1–100.

İfadesi değişebilecek metinler#

Şunlar Telegram'daki adlandırmaya göre seçildi ama Telegram'ın birebir metniyle doğrulanamadı. Bunlara metinle bağlanma, error_code'u esas al:

URL_INVALID · MESSAGE_TOO_LONG · GAME_SHORTNAME_INVALID · BOT_SCORE_NOT_MODIFIED · USER_ID_INVALID · parameter "<ad>" is required · can't parse rich message: … · widget HTML is empty/too long/too big after compression · widget data is too long · wrong widget width/height specified · poll must have at least 1 option · poll can't have more than 12 options · poll question must be non-empty · poll question length must not exceed 300 · poll options length must not exceed 100 · wrong correct option ID specified · explanation is too long · wrong close date specified · poll has already been closed · invalid draft_id specified · component is empty · component schema: … · fallback_text is empty/too long · inki_importance must be … · can't parse keyboard button JSON object · user not found · QUERY_ID_INVALID · RESULT_TYPE_INVALID · RESULT_ID_INVALID · BOT_DOMAIN_INVALID

Yalnız inkiveta'da olan hatalar#

MetinAnlamı
400 Bad Request: method is not available for bots on this platformYöntem inkiveta'da yok (grup, kanal, inline…) — Yöntem listesi
403 Forbidden: bot is suspendedUygulama askıda
400 Bad Request: payments are not enabledÖdemeler bu uygulama için henüz açık değil
400 Bad Request: component schema: <json-yolu>: <kural>Bileşen şemaya uymuyor (Bileşenler)
400 Bad Request: data deletion request not foundOnaylanmak istenen veri silme talebi yok ya da kullanıcı uyuşmuyor
400 Bad Request: REFUND_DEBT_LIMITİade, sahip borcunu 1.000 Ink'in üstüne çıkarırdı
400 Bad Request: REFUND_WALLET_INSUFFICIENT14 günlük pencereden sonraki iade için cüzdanın yetmiyor
400 Bad Request: REFUND_PREVIOUS_OWNERÖdeme uygulamanın önceki sahibinin döneminden
400 Bad Request: INKI_PRODUCT_CLASS_INVALIDinki_product_class hatalı
400 Bad Request: PAYMENT_PROVIDER_INVALID / CURRENCY_INVALIDDijital ürüne provider_token verilmiş / Ink faturasına provider_token verilmiş
400 Bad Request: bad webhook: hosting country must be declared in Atölye before enabling (KVKK md.9)Barındırma ülkesi beyan edilmemiş
400 Bad Request: bad webhook: cross-border transfer agreement must be accepted in Atölye before enabling (KVKK md.9)Yurt dışı aktarım sözleşmesi kabul edilmemiş
400 Bad Request: bad webhook: hosting country mismatch: … · 409 Conflict: can't use getUpdates method: hosting country mismatch: …Beyan Türkiye ama sunucu IP'si yurt dışında (Gizlilik)
409 Conflict: can't use getUpdates method while the hosted flow is active; … · … setWebhook …Akış editörü yayında (Akış)
400 Bad Request: managed bot not foundYönetilen bot bulunamadı ya da sana ait değil
400 Bad Request: STICKER_VIDEO_INVALID: …Video çıkartması şu an dönüştürülemiyor
403 Forbidden: CALL_NOT_ALLOWEDKullanıcı Damla araması için izin vermemiş ya da kapatmış (Damla aramaları)
403 Forbidden: CALL_ACCESS_RECENTLY_DECLINEDArama izni yakın zamanda reddedildi (Damla aramaları)
403 Forbidden: CALL_SUSPENDEDUygulamanın Damla araması şikâyetler nedeniyle askıda (Damla aramaları)
402 Payment Required: CALL_BALANCE_INSUFFICIENTDamla arama cüzdanında yeterli bakiye yok (Damla aramaları)
400 Bad Request: CALL_PURPOSE_REQUIREDDamla aramasında amaç beyanı eksik (Damla aramaları)
400 Bad Request: CALL_TEMPLATE_INVALID · CALL_PARAM_INVALID: <ad> · CALL_FIELD_INVALID: <key> · CALL_FIELD_FORBIDDEN: <key> · CALL_CONTENT_REJECTEDDamla arama isteği kurala uymuyor (Damla aramaları)
400 Bad Request: CALL_USER_UNSUPPORTED · CALL_ALREADY_STARTED · CALL_REQUEST_NOT_FOUND · damla calls are not enabledDamla araması yapılamıyor / iptal edilemiyor (Damla aramaları)
403 Forbidden: NOTIFICATIONS_DISABLEDKullanıcı uygulamanın bildirimlerini ya da bu kategoriyi kapattı (Mini App bildirimleri)
403 Forbidden: NOTIFICATIONS_SUSPENDEDUygulamanın bildirimleri şikâyetler nedeniyle askıda (Mini App bildirimleri)
400 Bad Request: NOTIFICATION_CATEGORY_INVALID · NOTIFICATION_TITLE_TOO_LONG · NOTIFICATION_BODY_TOO_LONG · NOTIFICATION_CONTENT_REJECTED · NOTIFICATION_IMPORTANCE_INVALID · NOTIFICATION_WEB_APP_REQUIRED · START_PARAM_INVALIDBildirim isteği kurala uymuyor (Mini App bildirimleri)
400 Bad Request: GAME_ROOM_PLAYERS_INVALID · GAME_ROOM_MODE_INVALID · GAME_ROOM_NOT_FOUND · GAME_ROOM_CLOSED · GAME_ROOM_FULLOyun odası isteği yapılamıyor (Oyun odaları)
400 Bad Request: GAME_ROOM_NOT_PLAYEDsetGameScore'daki game_room_id doğrulanmadı: kişi o odada oynamamış (Oyun odaları)
403 Forbidden: GAME_ROOMS_SUSPENDEDUygulamanın oyun odaları şikâyetler nedeniyle askıda (Oyun odaları)

Sağlam bir hata işleyici#

pythonimport asyncio
from telegram.error import RetryAfter, Forbidden, BadRequest, TimedOut, NetworkError

async def guvenli_gonder(bot, chat_id, metin, deneme=3):
    for _ in range(deneme):
        try:
            return await bot.send_message(chat_id, metin)
        except RetryAfter as e:
            await asyncio.sleep(e.retry_after)
        except Forbidden as e:
            if "blocked by the user" in e.message:
                kullaniciyi_pasif_yap(chat_id)
            return None                      # "can't initiate": kullanıcıyı tutmaya devam
        except BadRequest:
            raise                            # isteğinde hata var; tekrar denemek işe yaramaz
        except (TimedOut, NetworkError):
            await asyncio.sleep(1)
    return None