-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
# author: wzpan | ||
# 闲聊一下 | ||
|
||
import logging | ||
from robot.sdk.AbstractPlugin import AbstractPlugin | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Plugin(AbstractPlugin): | ||
|
||
IS_IMMERSIVE = True | ||
|
||
def handle(self, text, parsed): | ||
|
||
if "闲聊一下" in text or "进入闲聊" in text: | ||
# 进入闲聊模式 | ||
self.say("好的,已进入闲聊模式", cache=True) | ||
else: | ||
self.clearImmersive() # 去掉沉浸式 | ||
self.say("结束闲聊", cache=True) | ||
|
||
def isValid(self, text, parsed): | ||
return any(word in text.lower() for word in ["闲聊一下", "进入闲聊", "结束闲聊", "退出闲聊"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters