-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
executable file
·49 lines (37 loc) · 1.77 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# TODO: Add an appropriate license to your skill before publishing. See
# the LICENSE file for more information.
# Below is the list of outside modules you'll be using in your skill.
# They might be built-in to Python, from mycroft-core or from external
# libraries. If you use an external library, be sure to include it
# in the requirements.txt file so the library is installed properly
# when the skill gets installed later by a user.
from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill, intent_handler
from mycroft.util.log import LOG
class MomoSkill(MycroftSkill):
# The constructor of the skill, which calls MycroftSkill's constructor
def __init__(self):
super(MomoSkill, self).__init__(name="Momo")
# Initialize working variables used within the skill.
self.iterests = ["card games", "sports", "movies", "reading", "walking", "gardening"]
def initialize(self):
self.add_event('recognizer_loop:wakeword', self.handle_hey_momo)
def handle_hey_momo(self, message):
self.speak_dialog("heyMomo")
@intent_handler(IntentBuilder("").require("test.intent"))
def handle_test_intent(self, message):
self.speak_dialog("test")
# @intent_handler(IntentBuilder("").require("Count").require("Dir"))
# def handle_count_intent(self, message):
# if message.data["Dir"] == "up":
# self.count += 1
# else: # assume "down"
# self.count -= 1
# self.speak_dialog("count.is.now", data={"count": self.count})
def stop(self):
self.speak_dialog("stop")
return True
# The "create_skill()" method is used to create an instance of the skill.
# Note that it's outside the class itself.
def create_skill():
return MomoSkill()