mirror of
https://github.com/idootop/mi-gpt.git
synced 2025-04-08 06:50:56 +00:00
fix: update default room name and description
This commit is contained in:
parent
772ad22200
commit
aae3202c98
|
@ -22,7 +22,7 @@
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"db:gen": "npx prisma migrate dev --name hello",
|
"db:gen": "npx prisma migrate dev --name hello",
|
||||||
"db:reset": "rm .bot.json && npx prisma migrate reset",
|
"db:reset": "rm .bot.json && npx prisma migrate reset",
|
||||||
"prepublish": "npm run build"
|
"prepublish": "yarn db:gen && npm run build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^5.8.1",
|
"@prisma/client": "^5.8.1",
|
||||||
|
|
|
@ -103,10 +103,16 @@ class _BotConfig {
|
||||||
} as any;
|
} as any;
|
||||||
}
|
}
|
||||||
let { bot, master, room } = currentConfig;
|
let { bot, master, room } = currentConfig;
|
||||||
bot = (await UserCRUD.addOrUpdate(currentConfig.bot)) ?? oldConfig.bot;
|
const newDefaultRoomName = `${master.name}和${bot.name}的私聊`;
|
||||||
master =
|
if (room.name.endsWith("的私聊")) {
|
||||||
(await UserCRUD.addOrUpdate(currentConfig.master)) ?? oldConfig.master;
|
room.name = config.room?.name ?? newDefaultRoomName;
|
||||||
room = (await RoomCRUD.addOrUpdate(currentConfig.room)) ?? oldConfig.room;
|
}
|
||||||
|
if (room.description.endsWith("的私聊")) {
|
||||||
|
room.description = config.room?.description ?? newDefaultRoomName;
|
||||||
|
}
|
||||||
|
bot = (await UserCRUD.addOrUpdate(bot)) ?? oldConfig.bot;
|
||||||
|
master = (await UserCRUD.addOrUpdate(master)) ?? oldConfig.master;
|
||||||
|
room = (await RoomCRUD.addOrUpdate(room)) ?? oldConfig.room;
|
||||||
return { bot, master, room };
|
return { bot, master, room };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user