mirror of
https://github.com/leon-ai/leon.git
synced 2024-11-28 12:43:35 +03:00
refactor(server): rename obj
to skillAnswer
This commit is contained in:
parent
8c91d245e8
commit
251950384e
@ -212,17 +212,17 @@ export default class Brain {
|
||||
data: Buffer
|
||||
): Promise<Error | null> | void {
|
||||
try {
|
||||
const obj = JSON.parse(data.toString()) as AnswerOutput
|
||||
const skillAnswer = JSON.parse(data.toString()) as AnswerOutput
|
||||
|
||||
if (typeof obj === 'object') {
|
||||
if (typeof skillAnswer === 'object') {
|
||||
LogHelper.title(`${this.skillFriendlyName} skill (on data)`)
|
||||
LogHelper.info(data.toString())
|
||||
|
||||
if (obj.output.widget) {
|
||||
SOCKET_SERVER.socket?.emit('widget', obj.output.widget)
|
||||
if (skillAnswer.output.widget) {
|
||||
SOCKET_SERVER.socket?.emit('widget', skillAnswer.output.widget)
|
||||
}
|
||||
|
||||
const { answer } = obj.output
|
||||
const { answer } = skillAnswer.output
|
||||
if (!this.isMuted) {
|
||||
this.talk(answer)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user