daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Jun 10th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unc main() {
  2.     tgbot := tgm.BotAPI
  3.     go tgbot.GetMessages()
  4.     go tgbot.SendMessages()
  5.  
  6.     dialogflow := df.DialogFlowClient
  7.     fmt.Println(dialogflow)
  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.             someText.Response = "Got " + someText.Request
  17.             fmt.Println(someText.ID, someText.Request, someText.Response)
  18.         }
  19.     }()
  20.  
  21.     go func() {
  22.         for someResp := range dialogflow.ResponseChannel {
  23.             tgbot.SendMessagesChan <- &tgm.TgMsg{
  24.                 ID:       someResp.ID,
  25.                 Request:  someResp.Request,
  26.                 Response: someResp.Response,
  27.             }
  28.         }
  29.     }()
  30.  
  31.     <-mainStopSwitch
  32. }
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