Ejemplo n.º 1
0
class DefinePlugin(WillPlugin):
    def __init__(self, *args, **kwargs):
        self.dictionary = Dictionary()
        return WillPlugin.__init__(self, *args, **kwargs)

    @respond_to("^define (?P<word>[a-zA-Z]+)$")
    def define(self, message, word):
        """
        define ___: Get the definition of a word
        """
        return self.reply(message, self.dictionary.get_definition(word))