mirror of
https://github.com/leon-ai/leon.git
synced 2024-11-27 16:16:48 +03:00
feat(server): trigger unsupported language
This commit is contained in:
parent
cbb48213d2
commit
1845eed71d
@ -52,6 +52,11 @@
|
||||
"Hey, it looks like a new language, give me a sec so I make the switch",
|
||||
"You are speaking another language, let me do the switch please",
|
||||
"Wow, you can speak several languages, so do I! One moment please"
|
||||
],
|
||||
"random_language_not_supported": [
|
||||
"Sorry, I don't speak this language yet",
|
||||
"You are awesome, but I can't speak this language yet",
|
||||
"It looks like a language I can't understand at the moment"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
"route": "/api/action/games/guess_the_number/confirm",
|
||||
"route": "/api/action/games/guess_the_number/decide",
|
||||
"params": []
|
||||
},
|
||||
{
|
||||
|
@ -111,6 +111,13 @@ class Nlu {
|
||||
}
|
||||
}
|
||||
|
||||
// Language isn't supported
|
||||
if (!lang.getShortLangs().includes(locale)) {
|
||||
this.brain.talk(`${this.brain.wernicke('random_language_not_supported')}.`, true)
|
||||
this.brain.socket.emit('is-typing', false)
|
||||
return resolve({ })
|
||||
}
|
||||
|
||||
// Trigger language switch
|
||||
if (this.brain.lang !== locale) {
|
||||
const connectedHandler = async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user