Skip to content

Slack from Google Assistant

Ritik kumar edited this page Feb 21, 2021 · 1 revision

Slack from Google Assistant

Slack from google assistant is an action which sends message in slack and gets information of MDG members in google assistant.

Creating Action

  • For creating a new action, add a project in Google Actions Console. Follow the steps for doing a quick setup and move on to building your action.
  • In the Dialogflow Console create a new intert for your action, which requires providing training phrases, extracting useful parameters from user sentences and doing the needful action.
  • 'bro send $message' and 'bro info $name' were provided as training phases and $message and $name were extracted as parameters.
  • Now for required action to be performed fulfillment needs to be enabled. In this case action was to send message in slack or get info from the sheet which were to be handled by MDG bot. So a POST request was sent to hubot containing all the parameters in fulfillment section.

Providing Response

  • Now MDG bot listens the Dialogflow request at '/hubot/slack' mentioned in httpd.coffee script.
  • What it does is extract the parameters from request body, if the sentence contains a message then the action is to send a message to channel and if it contains name then action is to get info from sheet and give a response.
  • In former case, it will be a default response but for the latter it needs to be sent in a proper format available here.

Testing and Deployment

  • Action created can be tested simultaneously in the DialogFlow console itself. It can also be tested through the developer's account on mobile.
  • After action is created it can be released for alpha testing among a set of users whose email will be provided by you. You have to send an opt in link to them for starting.
  • Action 'slack mdg' can be used by typing 'talk to slack mdg' on google assistant. This starts a conversation with action. Sending action message can be accessed by 'bro send $message' and info action by 'bro info $name'.
  • After satisfied by alpha testing it can be released for beta testing and given for review by following the steps on Action Console.