PHP Бот вк

Tema05

Известный
Автор темы
1,442
401
Проблема в том что как только я добавляю ещё 1 кнопку бот перестаёт работать
Использую php и vk api 5.103. Ниже есть пример как я отображаю кнопки и он полностью работает.
Но как только я в 3 линии добавляю 4тую кнопку с надписью '13' бот перестаёт работать и отображать кнопки. Ниже показан нерабочий пример.
Добавлением данной кнопки я не нарушаю максимальные размеры 5x10 и лимит в 40 кнопок указанный в документации.
PHP:
//РАБОТАЕТ
'keyboard' => json_encode([
    'buttons' => [
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"1"}',
                    'label' => '1'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"2"}',
                    'label' => '2'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"3"}',
                    'label' => '3'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"4"}',
                    'label' => '4'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"5"}',
                    'label' => '5'
                ],
                'color' => 'negative'
            ]
        ],
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"6"}',
                    'label' => '6'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"7"}',
                    'label' => '7'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"8"}',
                    'label' => '8'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"9"}',
                    'label' => '9'
                ],
                'color' => 'negative'
            ]
        ],
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"10"}',
                    'label' => '10'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"11"}',
                    'label' => '11'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"12"}',
                    'label' => '12'
                ],
                'color' => 'negative'
            ]
        ],
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"menu"}',
                    'label' => '❌'
                ],
                'color' => 'primary'
            ]
        ]
    ]
], JSON_UNESCAPED_UNICODE)
PHP:
//НЕ РАБОТАЕТ
'keyboard' => json_encode([
    'buttons' => [
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"1"}',
                    'label' => '1'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"2"}',
                    'label' => '2'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"3"}',
                    'label' => '3'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"4"}',
                    'label' => '4'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"5"}',
                    'label' => '5'
                ],
                'color' => 'negative'
            ]
        ],
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"6"}',
                    'label' => '6'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"7"}',
                    'label' => '7'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"8"}',
                    'label' => '8'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"9"}',
                    'label' => '9'
                ],
                'color' => 'negative'
            ]
        ],
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"10"}',
                    'label' => '10'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"11"}',
                    'label' => '11'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"12"}',
                    'label' => '12'
                ],
                'color' => 'negative'
            ],
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"statistics_server", "server_id":"13"}',
                    'label' => '13'
                ],
                'color' => 'negative'
            ]
        ],
        [
            [
                'action' => [
                    'type' => 'text',
                    'payload' => '{"button":"menu"}',
                    'label' => '❌'
                ],
                'color' => 'primary'
            ]
        ]
    ]
], JSON_UNESCAPED_UNICODE)