Make whois ephemeral outside staff channels

This commit is contained in:
Tarrgon
2025-05-29 09:56:27 -04:00
parent f8f326ec6b
commit 6197697932
3 changed files with 11 additions and 10 deletions
+5 -4
View File
@@ -3,6 +3,9 @@ import { config } from '../config';
import { Database } from '../shared/Database';
export async function handleWhoIsInteraction(interaction: CommandInteraction, idToUse: string, ephemeral = false) {
if (ephemeral) await interaction.deferReply({ flags: [MessageFlags.Ephemeral] });
else await interaction.deferReply();
const results = await Database.getE621Ids(idToUse);
if (results.length > 0) {
@@ -25,10 +28,8 @@ export async function handleWhoIsInteraction(interaction: CommandInteraction, id
content += `\n\nDiscord alts found:\n${mappedAlts}`;
}
if (ephemeral) interaction.reply({ content, flags: [MessageFlags.Ephemeral] });
else interaction.reply(content);
interaction.editReply(content);
} else {
if (ephemeral) interaction.reply({ content: 'No e621 accounts found for this user', flags: [MessageFlags.Ephemeral] });
else interaction.reply('No e621 accounts found for this user');
interaction.editReply('No e621 accounts found for this user');
}
}