I
I
Ivan Wagner2020-01-15 11:01:32
In contact with
Ivan Wagner, 2020-01-15 11:01:32

Why error 100 in vk bot?

Hello! There is a code, the bot should, in theory, mark messages as read:

$vk->request('messages.markAsRead', ['message_ids' => $msg_id, 'peer_id' => $peer_id]);

But for some reason I get errors:
[Exception]: an error occurred:
[Exception]: text: {"error":{"error_code":100,"error_msg":"One of the parameters specified was missing or invalid: message is empty or invalid","request_params":[{"key":"method","value":"messages.send"},{"key":"oauth","value":"1"},{"key ":"peer_id","value":"476598060"},{"key":"v","value":"5.103"},{"key":"random_id","value":"1344668602"} ]}}
[Exception]: error code: 100
[Exception]: file: /home/blah/blah/blah/public_html/test/simplevk-master/src/vk_api.php:223
[Exception]: error path:#0 /home/blah/blah/blah/public_html/test/simplevk-master/src/vk_api.php(392): DigitalStar\vk_api\vk_api->request('messages.send', Array)
#1 /home/blah/blah/blah/public_html/test/bot.php(98): DigitalStar\vk_api\vk_api->sendMessage('476598060', '')
#2 {main}
I even tried this:
$vk->request('messages.markAsRead', ['message_ids' => $msg_id, 'peer_id' => 'ID группы']);

Tell me why the bot does not want to mark messages as read and swears. API version 5.103

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Minovsky, 2020-01-19
@manavar_g

The error is not in messages.markAsRead, but in sendMessage('476598060', ''). Message is empty

S
sergeyfilippov4, 2020-01-15
@sergeyfilippov4

Well, the error says - the message is empty

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question