@builderbot/cli 1.0.19-alpha.0 → 1.0.21-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/starters/apps/base-js-baileys-json/src/app.js +10 -5
- package/dist/starters/apps/base-js-baileys-memory/src/app.js +10 -5
- package/dist/starters/apps/base-js-baileys-mongo/src/app.js +10 -5
- package/dist/starters/apps/base-js-baileys-mysql/src/app.js +10 -5
- package/dist/starters/apps/base-js-baileys-postgres/src/app.js +10 -5
- package/dist/starters/apps/base-js-meta-json/src/app.js +10 -5
- package/dist/starters/apps/base-js-meta-memory/src/app.js +10 -5
- package/dist/starters/apps/base-js-meta-mongo/src/app.js +10 -5
- package/dist/starters/apps/base-js-meta-mysql/src/app.js +10 -5
- package/dist/starters/apps/base-js-meta-postgres/src/app.js +10 -5
- package/dist/starters/apps/base-js-twilio-json/src/app.js +10 -5
- package/dist/starters/apps/base-js-twilio-memory/src/app.js +10 -5
- package/dist/starters/apps/base-js-twilio-mongo/src/app.js +10 -5
- package/dist/starters/apps/base-js-twilio-mysql/src/app.js +10 -5
- package/dist/starters/apps/base-js-twilio-postgres/src/app.js +10 -5
- package/dist/starters/apps/base-js-venom-json/src/app.js +10 -5
- package/dist/starters/apps/base-js-venom-memory/src/app.js +10 -5
- package/dist/starters/apps/base-js-venom-mongo/src/app.js +10 -5
- package/dist/starters/apps/base-js-venom-mysql/src/app.js +10 -5
- package/dist/starters/apps/base-js-venom-postgres/src/app.js +10 -5
- package/dist/starters/apps/base-js-wppconnect-json/src/app.js +10 -5
- package/dist/starters/apps/base-js-wppconnect-memory/src/app.js +10 -5
- package/dist/starters/apps/base-js-wppconnect-mongo/src/app.js +10 -5
- package/dist/starters/apps/base-js-wppconnect-mysql/src/app.js +10 -5
- package/dist/starters/apps/base-js-wppconnect-postgres/src/app.js +10 -5
- package/dist/starters/apps/base-ts-baileys-json/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-baileys-memory/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-baileys-mongo/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-baileys-mysql/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-baileys-postgres/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-meta-json/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-meta-memory/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-meta-mongo/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-meta-mysql/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-meta-postgres/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-twilio-json/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-twilio-memory/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-twilio-mongo/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-twilio-mysql/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-twilio-postgres/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-venom-json/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-venom-memory/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-venom-mongo/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-venom-mysql/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-venom-postgres/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-wppconnect-json/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-wppconnect-memory/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-wppconnect-mongo/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-wppconnect-mysql/src/app.ts +10 -5
- package/dist/starters/apps/base-ts-wppconnect-postgres/src/app.ts +10 -5
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -9124,7 +9124,7 @@ const bannerDone = (templateName = '') => {
|
|
|
9124
9124
|
color.yellow(` npm start `),
|
|
9125
9125
|
``,
|
|
9126
9126
|
`📄 Documentación y Curso:`,
|
|
9127
|
-
` https://
|
|
9127
|
+
` https://builderbot.vercel.app`,
|
|
9128
9128
|
``,
|
|
9129
9129
|
`🤖 ¿Problemas? Únete:`,
|
|
9130
9130
|
` https://link.codigoencasa.com/DISCORD`,
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -78,8 +83,8 @@ const main = async () => {
|
|
|
78
83
|
'/v1/blacklist',
|
|
79
84
|
handleCtx(async (bot, req, res) => {
|
|
80
85
|
const { number, intent } = req.body
|
|
81
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
82
|
-
if (intent === 'add') bot.blacklist.add(
|
|
86
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
87
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
83
88
|
|
|
84
89
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
85
90
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -77,8 +82,8 @@ const main = async () => {
|
|
|
77
82
|
'/v1/blacklist',
|
|
78
83
|
handleCtx(async (bot, req, res) => {
|
|
79
84
|
const { number, intent } = req.body
|
|
80
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
81
|
-
if (intent === 'add') bot.blacklist.add(
|
|
85
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
86
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
82
87
|
|
|
83
88
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
84
89
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -80,8 +85,8 @@ const main = async () => {
|
|
|
80
85
|
'/v1/blacklist',
|
|
81
86
|
handleCtx(async (bot, req, res) => {
|
|
82
87
|
const { number, intent } = req.body
|
|
83
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
84
|
-
if (intent === 'add') bot.blacklist.add(
|
|
88
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
89
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
85
90
|
|
|
86
91
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
87
92
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -82,8 +87,8 @@ const main = async () => {
|
|
|
82
87
|
'/v1/blacklist',
|
|
83
88
|
handleCtx(async (bot, req, res) => {
|
|
84
89
|
const { number, intent } = req.body
|
|
85
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
86
|
-
if (intent === 'add') bot.blacklist.add(
|
|
90
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
91
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
87
92
|
|
|
88
93
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
89
94
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -83,8 +88,8 @@ const main = async () => {
|
|
|
83
88
|
'/v1/blacklist',
|
|
84
89
|
handleCtx(async (bot, req, res) => {
|
|
85
90
|
const { number, intent } = req.body
|
|
86
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
87
|
-
if (intent === 'add') bot.blacklist.add(
|
|
91
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
92
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
88
93
|
|
|
89
94
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
90
95
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -82,8 +87,8 @@ const main = async () => {
|
|
|
82
87
|
'/v1/blacklist',
|
|
83
88
|
handleCtx(async (bot, req, res) => {
|
|
84
89
|
const { number, intent } = req.body
|
|
85
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
86
|
-
if (intent === 'add') bot.blacklist.add(
|
|
90
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
91
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
87
92
|
|
|
88
93
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
89
94
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -81,8 +86,8 @@ const main = async () => {
|
|
|
81
86
|
'/v1/blacklist',
|
|
82
87
|
handleCtx(async (bot, req, res) => {
|
|
83
88
|
const { number, intent } = req.body
|
|
84
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
85
|
-
if (intent === 'add') bot.blacklist.add(
|
|
89
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
90
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
86
91
|
|
|
87
92
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
88
93
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -84,8 +89,8 @@ const main = async () => {
|
|
|
84
89
|
'/v1/blacklist',
|
|
85
90
|
handleCtx(async (bot, req, res) => {
|
|
86
91
|
const { number, intent } = req.body
|
|
87
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
88
|
-
if (intent === 'add') bot.blacklist.add(
|
|
92
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
93
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
89
94
|
|
|
90
95
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
91
96
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -86,8 +91,8 @@ const main = async () => {
|
|
|
86
91
|
'/v1/blacklist',
|
|
87
92
|
handleCtx(async (bot, req, res) => {
|
|
88
93
|
const { number, intent } = req.body
|
|
89
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
90
|
-
if (intent === 'add') bot.blacklist.add(
|
|
94
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
95
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
91
96
|
|
|
92
97
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
93
98
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -87,8 +92,8 @@ const main = async () => {
|
|
|
87
92
|
'/v1/blacklist',
|
|
88
93
|
handleCtx(async (bot, req, res) => {
|
|
89
94
|
const { number, intent } = req.body
|
|
90
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
91
|
-
if (intent === 'add') bot.blacklist.add(
|
|
95
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
96
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
92
97
|
|
|
93
98
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
94
99
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -81,8 +86,8 @@ const main = async () => {
|
|
|
81
86
|
'/v1/blacklist',
|
|
82
87
|
handleCtx(async (bot, req, res) => {
|
|
83
88
|
const { number, intent } = req.body
|
|
84
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
85
|
-
if (intent === 'add') bot.blacklist.add(
|
|
89
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
90
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
86
91
|
|
|
87
92
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
88
93
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -80,8 +85,8 @@ const main = async () => {
|
|
|
80
85
|
'/v1/blacklist',
|
|
81
86
|
handleCtx(async (bot, req, res) => {
|
|
82
87
|
const { number, intent } = req.body
|
|
83
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
84
|
-
if (intent === 'add') bot.blacklist.add(
|
|
88
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
89
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
85
90
|
|
|
86
91
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
87
92
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -83,8 +88,8 @@ const main = async () => {
|
|
|
83
88
|
'/v1/blacklist',
|
|
84
89
|
handleCtx(async (bot, req, res) => {
|
|
85
90
|
const { number, intent } = req.body
|
|
86
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
87
|
-
if (intent === 'add') bot.blacklist.add(
|
|
91
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
92
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
88
93
|
|
|
89
94
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
90
95
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -85,8 +90,8 @@ const main = async () => {
|
|
|
85
90
|
'/v1/blacklist',
|
|
86
91
|
handleCtx(async (bot, req, res) => {
|
|
87
92
|
const { number, intent } = req.body
|
|
88
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
89
|
-
if (intent === 'add') bot.blacklist.add(
|
|
93
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
94
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
90
95
|
|
|
91
96
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
92
97
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -86,8 +91,8 @@ const main = async () => {
|
|
|
86
91
|
'/v1/blacklist',
|
|
87
92
|
handleCtx(async (bot, req, res) => {
|
|
88
93
|
const { number, intent } = req.body
|
|
89
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
90
|
-
if (intent === 'add') bot.blacklist.add(
|
|
94
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
95
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
91
96
|
|
|
92
97
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
93
98
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -78,8 +83,8 @@ const main = async () => {
|
|
|
78
83
|
'/v1/blacklist',
|
|
79
84
|
handleCtx(async (bot, req, res) => {
|
|
80
85
|
const { number, intent } = req.body
|
|
81
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
82
|
-
if (intent === 'add') bot.blacklist.add(
|
|
86
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
87
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
83
88
|
|
|
84
89
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
85
90
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -77,8 +82,8 @@ const main = async () => {
|
|
|
77
82
|
'/v1/blacklist',
|
|
78
83
|
handleCtx(async (bot, req, res) => {
|
|
79
84
|
const { number, intent } = req.body
|
|
80
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
81
|
-
if (intent === 'add') bot.blacklist.add(
|
|
85
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
86
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
82
87
|
|
|
83
88
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
84
89
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -80,8 +85,8 @@ const main = async () => {
|
|
|
80
85
|
'/v1/blacklist',
|
|
81
86
|
handleCtx(async (bot, req, res) => {
|
|
82
87
|
const { number, intent } = req.body
|
|
83
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
84
|
-
if (intent === 'add') bot.blacklist.add(
|
|
88
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
89
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
85
90
|
|
|
86
91
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
87
92
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|
|
@@ -25,12 +25,17 @@ const welcomeFlow = addKeyword(['hi', 'hello', 'hola'])
|
|
|
25
25
|
'I share with you the following links of interest about the project',
|
|
26
26
|
'👉 *doc* to view the documentation',
|
|
27
27
|
].join('\n'),
|
|
28
|
-
{ delay: 800 },
|
|
29
|
-
|
|
28
|
+
{ delay: 800, capture: true },
|
|
29
|
+
async (ctx, { fallBack }) => {
|
|
30
|
+
if (!ctx.body.toLocaleLowerCase().includes('doc')) {
|
|
31
|
+
return fallBack('You should type *doc*')
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
},
|
|
30
35
|
[discordFlow]
|
|
31
36
|
)
|
|
32
37
|
|
|
33
|
-
const registerFlow = addKeyword(utils.setEvent('
|
|
38
|
+
const registerFlow = addKeyword(utils.setEvent('REGISTER_EVENT'))
|
|
34
39
|
.addAnswer(`What is your name?`, { capture: true }, async (ctx, { state }) => {
|
|
35
40
|
await state.update({ name: ctx.body })
|
|
36
41
|
})
|
|
@@ -82,8 +87,8 @@ const main = async () => {
|
|
|
82
87
|
'/v1/blacklist',
|
|
83
88
|
handleCtx(async (bot, req, res) => {
|
|
84
89
|
const { number, intent } = req.body
|
|
85
|
-
if (intent === 'remove') bot.blacklist.remove(
|
|
86
|
-
if (intent === 'add') bot.blacklist.add(
|
|
90
|
+
if (intent === 'remove') bot.blacklist.remove(number)
|
|
91
|
+
if (intent === 'add') bot.blacklist.add(number)
|
|
87
92
|
|
|
88
93
|
res.writeHead(200, { 'Content-Type': 'application/json' })
|
|
89
94
|
return res.end(JSON.stringify({ status: 'ok', number, intent }))
|