'none found' fallback response

This commit is contained in:
Baipyrus 2024-04-05 10:51:17 +02:00
parent 7f39be34ad
commit 370361f9d3

View File

@ -207,6 +207,15 @@ async function infoResponse(interaction) {
}
});
// Abort if no responses registered
if (responses.length === 0) {
await interaction.reply({
content: 'No responses have been registered yet!',
ephemeral: true
});
return;
}
// Join list of responses
const joined = responses.map((response) => response.response).join('\n- ');