Get working

This commit is contained in:
Rigidity
2024-05-24 13:03:57 -04:00
parent b4be026419
commit e739db468f
2 changed files with 4 additions and 12 deletions

View File

@@ -68,20 +68,13 @@ async function handleList(
) {
const parentChannel = getParentChannel(interaction.channel);
if (!parentChannel) {
return interaction.reply({
return interaction.followUp({
ephemeral: true,
content:
'You can only use this command in a text channel or thread.',
});
}
if (!parentChannel.isTextBased()) {
return interaction.reply({
ephemeral: true,
content: 'The parent of the thread must be a text channel.',
});
}
const isHelpChannel = HELP_THREAD_CHANNELS.includes(parentChannel.id);
const threadsWithinChannel = visibleThreads.filter(
@@ -93,7 +86,7 @@ async function handleList(
: threadsWithinChannel.filter((thread) => thread.name.startsWith('❔'));
if (!threads.size) {
return interaction.reply({
return interaction.followUp({
ephemeral: true,
content: `There are no active threads in <#${parentChannel.id}>.`,
});
@@ -101,7 +94,7 @@ async function handleList(
const threadList = threads.map((thread) => `<#${thread.id}>`).join(', ');
await interaction.reply({
await interaction.followUp({
content: `Active threads in <#${parentChannel.id}>: ${threadList}`,
});
}

View File

@@ -9,9 +9,8 @@ export function wrapErrors(
} catch (error) {
console.error(error);
await interaction.reply({
await interaction.editReply({
content: `Runtime error: ${error}`,
ephemeral: true,
});
}
};