-
Notifications
You must be signed in to change notification settings - Fork 1
/
linto-skill-datetime.js
36 lines (31 loc) · 972 Bytes
/
linto-skill-datetime.js
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
const debug = require('debug')('linto:skill:v2:linto-skill:datetime')
const LintoSkillNode = require('@linto-ai/linto-components').nodes.lintoSkillNode
const { template } = require('@linto-ai/linto-components').components
const PALETTE_NODE_NAME = 'Datetime'
module.exports = function (RED) {
function Node(config) {
RED.nodes.createNode(this, config)
new LintoSkillDatetime(RED, this, config)
}
RED.nodes.registerType('linto-skill-datetime', Node,
{
settings: {
lintoSkillDatetime: {
value: {
template: template.settupSkillTemplate(PALETTE_NODE_NAME),
command: LintoSkillNode.loadFile(__dirname, 'data/command.md')
},
exportable: true
}
}
})
}
class LintoSkillDatetime extends LintoSkillNode {
constructor(RED, node, config) {
super(RED, node, config, __dirname)
this.init()
}
async init() {
await this.configure() // Autoload controllers
}
}