Как создать menu button для telegram group-ы с помощью api?

Есть такой сервис и он, к сожалению, не работает.

 async setMenuButton(chatId: number) : Promise<boolean> {
    const url = `${this.getTelegramApiUrl()}/setChatMenuButton`;
    const data = {
      "chat_id": chatId,
      "menu_button": {
          "type": "web_app",
          "text": "Магический шар",
          "web_app": {
              "url": "https://t.me/uliana_prisma_bot/uliana_prisma"
          }
      }
    }
    try {
      const response = await lastValueFrom(this.httpService.post(url, data, {
        headers: {
          'Content-Type': 'application/json',
        },
      }));
      const responseData = response.data;

      this.logger.log('Launch button success installed')
      this.logger.log(responseData)
      return true

    } catch (error) {
      this.logger.error('Error checking subscription status:', error);
      return false
    } 

  }

Если отправить запрос через POSTMAN то приходит такой ответ:

{
    "ok": false,
    "error_code": 400,
    "description": "Bad Request: can't parse menu button: Can't find field \"type\""
}

Это тот json, который я ему отправляю:

{
    "chat_id": -1001659278064,
    "menu_button": {
        "type": "web_app",
        "text": "Магический шар",
        "web_app": {
            "url": "https://t.me/uliana_prisma_bot/uliana_prisma"
        }
    }
}

Я не понимаю, что он от меня хочет


Ответы (0 шт):