Skip to content

Commit fc4f77a

Browse files
authored
Fix bp get option list (#162)
1 parent 001fb83 commit fc4f77a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/features/bp/bp-command.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,10 @@ To change this message, use \`/bp unset ${key}\` and then \`/bp set\` to set a n
297297
ApplicationCommandOptionChoiceData<string | number>[] | undefined
298298
> {
299299
const res = await prismaClient.batphone.findMany();
300-
if (isObject(res)) {
301-
const opts = Object.entries(res).map(([key, value]) => ({
302-
name: key,
303-
value: key,
304-
}));
305-
return opts;
306-
}
307-
return [];
300+
301+
return res.map((opt) => {
302+
return { name: opt.key, value: opt.key };
303+
});
308304
}
309305

310306
public get command() {

0 commit comments

Comments
 (0)