Allow overridden converse methods to accept messages
@@ -17,6 +17,7 @@ import os
from glob import glob
from threading import Thread, Event, Lock
from time import sleep, time, monotonic
+from inspect import signature
from mycroft.api import is_paired
from mycroft.enclosure.api import EnclosureAPI
@@ -445,6 +446,10 @@ class SkillManager(Thread):
try:
utterances = message.data['utterances']
lang = message.data['lang']
+ # check the signature of a converse method to either pass a message or not
+ if len(signature(skill_loader.instance.converse).parameters) == 3:
+ result = skill_loader.instance.converse(utterances, lang, message)
+ else:
result = skill_loader.instance.converse(utterances, lang)
self._emit_converse_response(result, message, skill_loader)
except Exception:
