R
R
Richard Hendrix2017-03-26 19:29:21
PHP
Richard Hendrix, 2017-03-26 19:29:21

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.
JnUDueCnWHk.jpg

Answer the question

In order to leave comments, you need to log in

4 answer(s)
X
xmoonlight, 2017-03-26
@xmoonlight

So you need a working code or what?
Endless loop and running in daemon mode.
Google "PHP Socket Server"

S
Sergey Sokolov, 2017-03-26
@sergiks

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.

Y
Yaroslav TheRock, 2017-03-26
@kickflip2009

ZennoPoster to the rescue!

M
Maxim Krasnikov, 2021-04-06
@Liss105

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 question

Ask a Question

731 491 924 answers to any question