plugins.Echo 源代码

# -*- coding: utf-8-*-
# author: wzpan
# 写诗

import logging
from robot.sdk.AbstractPlugin import AbstractPlugin

logger = logging.getLogger(__name__)

[文档]class Plugin(AbstractPlugin):
[文档] def handle(self, text, parsed): text = text.lower().replace('echo', '').replace(u'传话', '') self.say(text, cache=False)
[文档] def isValid(self, text, parsed): return any(word in text.lower() for word in ["echo", u"传话"])