feat: Add list item's description(result)

This commit is contained in:
Siwoo Jeon 2025-02-03 15:38:27 +09:00
parent 41fd07f4e7
commit 0cf961718c
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
2 changed files with 11 additions and 5 deletions

View file

@ -1,6 +1,6 @@
{
"name": "muffinbot",
"version": "4.1.0-pudding.r241119a",
"version": "4.1.1-pudding.r250203a",
"main": "dist/src/index.js",
"private": true,
"dependencies": {

View file

@ -27,7 +27,10 @@ export default class ListCommand extends Command {
user_id: user.id,
},
})
const list: string[] = []
const list: {
command: string
result: string
}[] = []
if (!data[0]) {
return await ctx.reply({
@ -36,8 +39,11 @@ export default class ListCommand extends Command {
})
}
for (const listData of data) {
list.push(listData.command)
for (const { command, result } of data) {
list.push({
command,
result,
})
}
await ctx.reply({
@ -46,7 +52,7 @@ export default class ListCommand extends Command {
title: `${user.username}님의 지식`,
description: `총합: ${data.length}\n${codeBlock(
'md',
list.map(item => `- ${item}`).join('\n'),
list.map(item => `- ${item.command}: ${item.result}`).join('\n'),
)}`,
color: this.container.embedColors.default,
timestamp: new Date().toISOString(),