Q
Q
quick_6_response2019-09-12 18:18:04
PHP
quick_6_response, 2019-09-12 18:18:04

How to edit one post?

There is a page script that is associated with a specific bot.
A person writes a certain command, then the bot sends it to the script (callback) and the script itself executes the command.
There are certain commands that need post-editing at intervals.
You need to write a function so that the editing happens, and does not go in one stream.
Part of the code as I tried to record editing

function messagesEdit($peerId, $message,$message_id, $options = []) {
    $add = '';
    if ($options)
      foreach ($options as $k => $val)
        $add .= '&' . urlencode($k) . '=' . urlencode($val);

    $res = $this->vkRequest('messages.send', 'random_id=' . mt_rand(0, 2000000000) . '&peer_id=' . urlencode($peerId) . "&message=".urlencode($message) . $add);
    return $res;
  }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question