mirror of
https://github.com/tauri-apps/tauri-discord-bot.git
synced 2026-01-31 00:35:21 +01:00
Get working
This commit is contained in:
@@ -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}`,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,9 +9,8 @@ export function wrapErrors(
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
await interaction.reply({
|
||||
await interaction.editReply({
|
||||
content: `Runtime error: ${error}`,
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user