Answer the question
In order to leave comments, you need to log in
How to make a bot that either answers a question clogged in the code, or does not read the PM of the group?
Tell me how to make a bot in PHP, which will be given certain commands. If the user sends this command to the VK chat, the bot answers him, and if this command is absent, then he does not read the PM at all.
For a group in VK you need. Maybe someone did something similar and left the code. Thank you!
Answer the question
In order to leave comments, you need to log in
Try not to ask him the answer if there is no command.
for example
$message = $user_message; // сообщение пользователя
if($message == '%команда%'){
$answer = '%ответ на команду%';
}
else{
$answer = ''; // на самом деле можно обойтись без этого, переменная в любом случае ничего содержать не будет
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question