refactor: dont paginate on one result

This commit is contained in:
Jacob Nguyen
2023-06-13 23:15:16 -05:00
committed by GitHub
parent b4a707c323
commit 5113d62250

View File

@@ -48,7 +48,6 @@ export default commandModule({
if (!result.length) {
return context.reply("No results found");
}
const embeds = result.map((res) => {
const comments =
res.node.kindString === TentacledKindString.Function
@@ -95,6 +94,9 @@ export default commandModule({
})
.setURL(res.node.sources[0].url ?? "External implementation");
});
if(embeds.length === 1) {
return context.reply({ embeds });
}
const paginator = new Paginator({ embeds });
return paginator.run(context.interaction);