I
I
Ivan Kutsenko2019-11-15 17:14:29
PHP
Ivan Kutsenko, 2019-11-15 17:14:29

How to make a "report" command?

The bottom line is that the "report" command was made, the essence is that the user writes this command, and then let's say what and where the bug he found. The bot sends that its message has been sent to the admin, i.e. me in pm.
But something went wrong, please help

if($cmd == "репорт"){
    $vk->sendMessage($peer_id, $id, "@id{$id} Напишите что (Вы) хотите отправить, (Вы) можете отправить найденный баг или предложить что-то новое");
    }else{
      $vk->sendMessage($peer_id, $id, "@id{$id} (Ваше) сообщение отправлено администратору");
    }
  }

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Puma Thailand, 2019-11-16
@opium

And what could go well there, if you process this command in the same way as others, that is, copy paste

L
Lyser777, 2019-11-17
@Lyser777

you need to do this:
user -> report [text] -> sendToAdmin[!adminHasReport ? [report_text +"\nEnter a response to this report in the next message"] : "A new report has arrived! Finish with the previous one" ]
admin -> [report_answer] -> sendToUser [report_answer] -> sendToAdmin[hasReports ? [report_text] : "No more reports"]

V
Viplayer, 2019-11-23
@Viplayer

You have an extra } and a condition, "if sms is not equal to report, then send to admin"...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question