feat: Add list item's description(result)
This commit is contained in:
parent
41fd07f4e7
commit
0cf961718c
2 changed files with 11 additions and 5 deletions
|
@ -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": {
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue