-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__init__.py
28 lines (21 loc) · 866 Bytes
/
__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
# Importing IntentBuilder
from adapt.intent import IntentBuilder
# Importing MycroftSkill class
from mycroft.skills.core import MycroftSkill
# Creating a skill extending MycroftSkill
class GoodNightSkill(MycroftSkill):
def __init__(self):
super(GoodNightSkill, self).__init__("GoodNightSkill")
def initialize(self):
# Creating an intent requiring vocab
good_night_intent = IntentBuilder("GoodNightIntent"). \
require("GoodNightKeyword").build()
# Associating a callback with the Intent
self.register_intent(good_night_intent, self.handle_good_night_intent)
def handle_good_night_intent(self, message):
# Sending a command to Mycroft, speak dialog
self.speak_dialog("goodnight")
def stop(self):
pass
def create_skill():
return GoodNightSkill()