Skip to content

Commit

Permalink
Update nbnhhsh.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rikumi authored Oct 24, 2024
1 parent 1ab4d14 commit 5a54086
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/nbnhhsh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export const handleSlashCommand = async (message: GeneralMessage) => {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text }),
});
return (await res.json()).map(({ name, trans }) => `${name}: ${trans.join(' ')}`).join('\n') || 'bn';
return (await res.json())
.filter(k => k.trans)
.map(({ name, trans }) => `${name}: ${trans.join(' ')}`).join('\n') || 'bn';
};

0 comments on commit 5a54086

Please sign in to comment.