daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Jun 11th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func main() {
  2.     tgbot := tgm.BotAPI
  3.     go tgbot.GetMessages()
  4.     go tgbot.SendMessages()
  5.  
  6.     dialogflow := df.DialogFlowClient
  7.     go dialogflow.DetectIntents()
  8.  
  9.     go func() {
  10.         for someText := range tgbot.GetMessagesChan {
  11.             dialogflow.RequestChannel <- &df.DFMessage{
  12.                 ID:      someText.ID,
  13.                 Request: someText.Request,
  14.             }
  15.         }
  16.     }()
  17.  
  18.     go func() {
  19.         for someResp := range dialogflow.ResponseChannel {
  20.             tgbot.SendMessagesChan <- &tgm.TgMsg{
  21.                 ID:       someResp.ID,
  22.                 Request:  someResp.Request,
  23.                 Response: someResp.Response,
  24.             }
  25.         }
  26.     }()
  27.  
  28.     <-mainStopSwitch
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top