Answer the question
In order to leave comments, you need to log in
What practices of writing bots do you know?
Gentlemen bot creators, what practices of writing bots do you know or recommend?
And I’ll say right away that there is no specific goal, I’m just interested in the filling of these same bots.
Code examples are welcome.
PHP code examples are doubly welcome.
Answer the question
In order to leave comments, you need to log in
So you need a working code or what?
Endless loop and running in daemon mode.
Google "PHP Socket Server"
Sign up to wit.ai and try setting up your own neural network high intelligence chatbot - it's all right there in the interface. Zero programming.
Then launch this chatbot in VK (in community messages , using callback api ) and let it chat with real users.
By following these simple steps, many of your questions will be solved by themselves.
In principle, I can advise a lot of practitioners, but if the purely internal part is interesting, then try this: https://chat-api.com/ru/whatsapp-bot-php.html I like that the codes that you needed, for example:
{ if(isset($decoded['messages'])){
foreach($decoded['messages'] as $message){
$text = explode(' ',trim($message['body' ]));
if(!$message['fromMe']){
switch(mb_strtolower($text[0],'UTF-8')){
case 'hi': {$this->welcome($message['chatId'], false); break;}
case 'chatId': {$this->showchatId($message['chatId']); break;}
case 'time': {$this->time($message['chatId']); break;}
case 'me': {$this->me($message['chatId'],$message['senderName']); break;}
case 'file': {$this->file($message['chatId'],$text[1]); break;}
case 'ptt': {$this->ptt($message['chatId']); break;}
case 'geo': {$this->geo($message['chatId']); break;}
case 'group': {$this->group($message['author']); break;}
default: {$this->welcome($message['chatId'],true); break;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question