Skip to content

Commit 5099e50

Browse files
deal with no search result found
1 parent e4089e2 commit 5099e50

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/docs/djs.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ const command: Command = {
3030

3131
const doc = await Doc.fetch(source, { force: true });
3232

33+
const resultEmbed = doc.resolveEmbed(query);
34+
3335
const notFoundEmbed = doc.baseEmbed();
3436
notFoundEmbed.description = "Didn't find any results for that query";
35-
36-
const resultEmbed = doc.resolveEmbed(query);
37-
38-
if (!resultEmbed) {
37+
if (!resultEmbed || (resultEmbed.description === "")) {
3938
const timeStampDate = new Date(notFoundEmbed.timestamp);
4039
const embedObj = { ...notFoundEmbed, timestamp: timeStampDate };
4140
interaction.editReply({ embeds: [embedObj] }).catch(console.error);

0 commit comments

Comments
 (0)