1
1
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:
louistiti 2023-05-28 12:53:44 +08:00
parent 8c91d245e8
commit 251950384e
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669

View File

@ -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)
}