fix: add persona field username

This commit is contained in:
Siwoo Jeon 2023-01-25 23:05:35 +09:00
parent 26f5997687
commit ba3f5ae0b2
Signed by: migan
GPG key ID: C4151385FFD2082A

View file

@ -45,9 +45,12 @@ export default class ChatBot {
} else {
if (this.trainType !== 'All') return
if (!msg.content.startsWith('머핀아 ')) return
const sql = `INSERT INTO statement(text, persona) VALUES('${msg.content
.replace('머핀아 ', '')
.replaceAll("'", '')}', 'user');`
const user = `user:${msg.author.username
.replaceAll("'", '')
.slice(0, 50)
.toLowerCase()}`
const text = msg.content.replace('머핀아 ', '').replaceAll("'", '')
const sql = `INSERT INTO statement(text, persona) VALUES('${text}', '${user}');`
this.db.run(sql, err => {
if (err) throw err
})