This commit is contained in:
2026-08-26 14:07:00 +08:00
parent 13dd614f13
commit 065522723e
2 changed files with 10 additions and 9 deletions
@@ -4,21 +4,22 @@ import { deleteUser } from "../../utils";
// ---------- // ----------
@SlashCommand( @SlashCommand(
new CommandBuilder('remove', 'Remove a user from the database.') new CommandBuilder('wipe', 'Wipe a user from the database.')
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall) .setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
.setContexts(Constants.InteractionContextType.Guild) .setContexts(Constants.InteractionContextType.Guild)
.setCommandType(Constants.ApplicationCommandType.ChatInput) .setCommandType(Constants.ApplicationCommandType.ChatInput)
.addUserOption('user', 'The user to remove.', true) .addUserOption('user', 'The user to wipe.', true)
) )
class RemoveCommand extends Command<CommandClient> { class WipeCommand extends Command<CommandClient> {
users = ['1363132678022631428']; users = ['1363132678022631428'];
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) { async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) {
await interaction.defer(true); console.log('tes');
const user = interaction.getRequiredUser('user');
await deleteUser(user.id);
await deleteUser(interaction.getRequiredUser('user').id); await interaction.createMessage({ content: `Successfully wiped: ${interaction.user.mention} (*${interaction.user.username}*)`});
await interaction.createMessage({ content: `Successfully removed: ${interaction.user.mention} (*${interaction.user.username}*)`});
} }
} }
export default new RemoveCommand('remove'); export default new WipeCommand('wipe');
+2 -2
View File
@@ -1,9 +1,9 @@
import init from "./admin/init"; import init from "./admin/init";
import remove from "./admin/remove"; import wipe from "./admin/wipe";
import optin from "./privacy/optin"; import optin from "./privacy/optin";
import optout from "./privacy/optout"; import optout from "./privacy/optout";
import profile from "./profile"; import profile from "./profile";
// ---------- // ----------
export default [init, optin, optout, profile, remove]; export default [init, optin, optout, profile, wipe];