mirror of
https://github.com/nx-bat/pet-the-pond.git
synced 2026-09-22 10:29:11 -04:00
wipe.
This commit is contained in:
@@ -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');
|
||||||
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user