本文整理汇总了Python中client.conversation.Conversation.wxbot方法的典型用法代码示例。如果您正苦于以下问题:Python Conversation.wxbot方法的具体用法?Python Conversation.wxbot怎么用?Python Conversation.wxbot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client.conversation.Conversation
的用法示例。
在下文中一共展示了Conversation.wxbot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from client.conversation import Conversation [as 别名]
# 或者: from client.conversation.Conversation import wxbot [as 别名]
def run(self):
salutation = (u"%s,我能为您做什么?" % config.get("first_name", u'主人'))
persona = config.get("robot_name", 'DINGDANG')
conversation = Conversation(persona, self.mic)
# create wechat robot
if config.get('wechat', False):
self.wxBot = WechatBot.WechatBot(conversation.brain)
self.wxBot.DEBUG = True
self.wxBot.conf['qr'] = 'tty'
conversation.wxbot = self.wxBot
t = threading.Thread(target=self.start_wxbot)
t.start()
self.mic.say(salutation, cache=True)
conversation.handleForever()
示例2: run
# 需要导入模块: from client.conversation import Conversation [as 别名]
# 或者: from client.conversation.Conversation import wxbot [as 别名]
def run(self):
if 'first_name' in self.config:
salutation = (u"%s 我能为您做什么?"
% self.config["first_name"])
else:
salutation = "主人,我能为您做什么?"
persona = 'DINGDANG'
if 'robot_name' in self.config:
persona = self.config["robot_name"]
conversation = Conversation(persona, self.mic, self.config)
# create wechat robot
if self.config['wechat']:
self.wxBot = WechatBot.WechatBot(conversation.brain)
self.wxBot.DEBUG = True
self.wxBot.conf['qr'] = 'tty'
conversation.wxbot = self.wxBot
t = threading.Thread(target=self.start_wxbot)
t.start()
self.mic.say(salutation, cache=True)
conversation.handleForever()