mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: list format
This commit is contained in:
parent
763e3f5b7d
commit
07203e4d74
1 changed files with 14 additions and 13 deletions
7
index.js
7
index.js
|
|
@ -29,7 +29,8 @@ export class chatgpt extends plugin {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: 'chatgpt对话列表',
|
reg: 'chatgpt对话列表',
|
||||||
fnc: 'getConversations'
|
fnc: 'getConversations',
|
||||||
|
permission: 'master'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: '^#结束对话([\s\S]*)',
|
reg: '^#结束对话([\s\S]*)',
|
||||||
|
|
@ -58,12 +59,12 @@ export class chatgpt extends plugin {
|
||||||
if (!keys || keys.length === 0) {
|
if (!keys || keys.length === 0) {
|
||||||
await this.reply('当前没有人正在与机器人对话', true)
|
await this.reply('当前没有人正在与机器人对话', true)
|
||||||
} else {
|
} else {
|
||||||
let response = '当前对话列表:(格式为【开始时间 qq昵称 对话长度 最后活跃时间】)\n'
|
let response = '当前对话列表:(格式为【开始时间 | qq昵称 | 对话长度 | 最后活跃时间】)\n'
|
||||||
await Promise.all(keys.map(async (key) => {
|
await Promise.all(keys.map(async (key) => {
|
||||||
let conversation = await redis.get(key)
|
let conversation = await redis.get(key)
|
||||||
if (conversation) {
|
if (conversation) {
|
||||||
conversation = JSON.parse(conversation)
|
conversation = JSON.parse(conversation)
|
||||||
response += `${conversation.ctime} ${conversation.sender.nickname} ${conversation.num} ${conversation.utime} \n`
|
response += `${conversation.ctime} | ${conversation.sender.nickname} | ${conversation.num} | ${conversation.utime} \n`
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
await this.reply(`${response}`, true)
|
await this.reply(`${response}`, true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue