correctly deal with "define previous message"

This commit is contained in:
jesopo 2019-12-29 07:27:37 +00:00
parent 069b0a9dab
commit 85d8ad1fe0

View file

@ -36,6 +36,11 @@ class Module(ModuleManager.BaseModule):
word = event["args"]
else:
word = event["target"].buffer.get(from_self=False)
if word:
word = word.message
if not word:
raise utils.EventError("No phrase provided")
word = word.replace(" ", "+")
success, definition = self._get_definition(word)