Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reaction in Conversation #3

Open
VarrkaN88 opened this issue Jul 16, 2020 · 1 comment
Open

Reaction in Conversation #3

VarrkaN88 opened this issue Jul 16, 2020 · 1 comment

Comments

@VarrkaN88
Copy link

VarrkaN88 commented Jul 16, 2020

Hello. How can I make a reaction to an event in Conversation and is it possible? Sorry for my English

@ff4m1r
Copy link
Owner

ff4m1r commented Jul 17, 2020

You can send "Is typing..." Action with (type()) or (typeAndWait(3)) which placed under Botter instance through $this->botter.
For example:

class SignupConversation extends Conversation {
     public function start()
     {
          $this->botter->typeAndWait(2); // Type and Wait for 2 seconds
          $this->say("What's your name?");
     }
}

For other actions (like send photo, send video or..) You should use the custom request builder to send a custom request to sendChatAction.
For example:

class SignupConversation extends Conversation {
     public function start()
     {
         $botter->buildRequest("sendChatAction")
                 ->chat_id($this->botter->getUserId()) // $this->botter->getUserId() returns current user chat_id
                 ->action('upload_photo')
                 ->send();
          $this->say("What's your name?");
     }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants