当用户类型为ID时,我想在chatbot(Botman)中显示产品信息,怎么办?

时间:2019-01-28 03:19:53

标签: php

使用BotMan \ BotMan \ Messages \ Conversations \ Conversation;使用BotMan \ BotMan \ Messages \ Incoming \ Answer;使用BotMan \ BotMan \ Messages \ Outgoing \ Question;使用App \ Models \ ProductCategory;使用App \ Models \ Product; OrderConversation类扩展了Conversation {受保护的$ ID_product;受保护的$ info_pro; public function order(){$ this-> ask('Type ID product:',function(Answer $ answer){//保存结果$ this-> ID_product = $ answer-> getText(); $ this-> say( '产品信息:'。$ this-> ID_product。$ product = Product :: where('id',$ id)); $ this-> bot-> userStorage()-> save(['ID_product'=> $ answer-> getText(),]); }); }

0 个答案:

没有答案