Перейти к содержимому
Главное меню
На этой странице

messenger.message.updated

Сообщение чата · изменение.

Типы SDK

Python: from shtab_sdk.events import MessengerMessageUpdated
TypeScript: import type { MessengerMessageUpdated } from '@shtab/sdk/webhooks'.

Поля события

  • event_id — Идентификатор события для дедупликации.

  • type — Тип события.

  • occurred_at — Время события в ISO 8601.

  • resource_type — Тип ресурса.

  • resource_id — ID ресурса.

  • task_id — Связанная задача.

  • project_id — Связанный проект.

  • actor_id — Пользователь, совершивший действие.

  • origin — Канал изменения.

  • changed_fields — Имена затронутых полей.

  • body — Данные ресурса, если доступны.

  • tombstone — Данные для идентификации удалённого ресурса.

Значения changed_fields: text.

Доставляется на webhook URL бота.

Пример доставки

{
  "delivery_id": "d94a840b-0e61-4af1-89cd-b5cbbd6d02da",
  "events": [
    {
      "event_id": "ea49f33e-a606-4872-8d3d-ad9e092fa97b",
      "type": "messenger.message.updated",
      "occurred_at": "2026-11-23T10:00:00Z",
      "resource_type": "messenger_message",
      "resource_id": 42,
      "task_id": null,
      "project_id": null,
      "actor_id": null,
      "origin": "app",
      "changed_fields": [],
      "body": {
        "id": 42,
        "chat_id": 42,
        "sender_id": 42,
        "kind": "text",
        "text": "Пример",
        "thread_root_id": 42,
        "reply_to_id": 42,
        "created_at": "2026-11-23T10:00:00Z",
        "edited_at": "2026-11-23T10:00:00Z"
      },
      "tombstone": null
    }
  ]
}

Схема события

{
  "type": "object",
  "properties": {
    "event_id": {
      "type": "string"
    },
    "type": {
      "const": "messenger.message.updated"
    },
    "occurred_at": {
      "type": "string"
    },
    "resource_type": {
      "const": "messenger_message"
    },
    "resource_id": {
      "type": "integer"
    },
    "task_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "project_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "actor_id": {
      "type": [
        "integer",
        "null"
      ]
    },
    "origin": {
      "type": "string"
    },
    "changed_fields": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "body": {
      "anyOf": [
        {
          "$ref": "#/definitions/BotMessage"
        },
        {
          "type": "null"
        }
      ]
    },
    "tombstone": {
      "type": "null"
    }
  },
  "required": [
    "event_id",
    "type",
    "occurred_at",
    "resource_type",
    "resource_id",
    "task_id",
    "project_id",
    "actor_id",
    "origin",
    "changed_fields",
    "body",
    "tombstone"
  ]
}

BotMessage

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "chat_id": {
      "type": "integer"
    },
    "sender_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "kind": {
      "enum": [
        "text",
        "system",
        "file",
        "voice",
        "video_note",
        "sticker",
        "gif",
        "poll",
        "assistant",
        "meeting_summary"
      ]
    },
    "text": {
      "type": "string"
    },
    "thread_root_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "reply_to_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string"
    },
    "edited_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "chat_id",
    "sender_id",
    "kind",
    "text",
    "thread_root_id",
    "reply_to_id",
    "created_at",
    "edited_at"
  ]
}