diff --git a/README.md b/README.md index 1c199d0..f9e7894 100755 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Query [Wikipedia](https://www.wikipedia.org) for answers to all your questions. This Skill uses the [Wikipedia for humans](https://github.com/HelloChatterbox/wikipedia_for_humans). +NOTE: this will blacklist the official mycroft skill ## Examples * "Tell me about Elon Musk" diff --git a/__init__.py b/__init__.py index 566d042..db85001 100755 --- a/__init__.py +++ b/__init__.py @@ -14,6 +14,8 @@ from adapt.intent import IntentBuilder from mycroft.skills.core import (MycroftSkill, intent_handler, intent_file_handler) +from mycroft.messagebus.message import Message +from mycroft.configuration import LocalConf, USER_CONFIG,Configuration class WikipediaSkill(MycroftSkill): @@ -22,6 +24,24 @@ def __init__(self): self.idx = 0 self.results = [] + def initialize(self): + self.blacklist_default_skill() + + def blacklist_default_skill(self): + core_conf = Configuration.load_config_stack() + blacklist = core_conf["skills"]["blacklisted_skills"] + if "mycroft-wiki.mycroftai" not in blacklist: + self.log.debug("Blacklisting official mycroft wikipedia skill") + blacklist.append("mycroft-wiki.mycroftai") + conf = LocalConf(USER_CONFIG) + if "skills" not in conf: + conf["skills"] = {} + conf["skills"]["blacklisted_skills"] = blacklist + conf.store() + + self.bus.emit(Message("detach_skill", + {"skill_id": "mycroft-wiki.mycroftai"})) + def speak_result(self): if self.idx + 1 > len(self.results): self.speak_dialog("thats all")