(rewrite): Mostly implemented /ban.
`/ban` & `/hardban` will need to be worked on properly by Tarrgon who knows more about the hell that is the database code.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// External Imports
|
||||
import { Command, CommandBuilder, CommandClient, CommandInteraction, Constants, SlashCommand } from 'athena-prime';
|
||||
|
||||
// ---------------
|
||||
|
||||
@SlashCommand(
|
||||
new CommandBuilder('hard-ban', 'Permanently bans a user, and all known alternate accounts.')
|
||||
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
|
||||
.setContexts(Constants.InteractionContextType.Guild)
|
||||
.setCommandType(Constants.ApplicationCommandType.ChatInput)
|
||||
.setMemberPermission(Constants.PermissionFlagsBits.BanMembers)
|
||||
.addUserOption('user', 'The user to ban.', true)
|
||||
.addStringOption({ name: 'reason', description: '(optional): The reason for banning the user.', required: false })
|
||||
.addBooleanOption('clean', "(optional): Clean the user's messages upwards of a day.", false)
|
||||
.addBooleanOption('purge', "(optional): Purge the user's messages from the database.", false)
|
||||
)
|
||||
class HardBanCommand extends Command<CommandClient> {
|
||||
cooldown = 5;
|
||||
userPermissions = [Constants.PermissionFlagsBits.BanMembers];
|
||||
|
||||
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction, fetchedData?: any) {
|
||||
if (!interaction.inGuild()) return;
|
||||
await interaction.defer();
|
||||
|
||||
const user = interaction.getRequiredMember('user');
|
||||
const reason = interaction.getString('reason') || 'No reason specified.';
|
||||
const clean = interaction.getBoolean('clean') || false;
|
||||
const purge = interaction.getBoolean('purge') || false;
|
||||
|
||||
// Nix -> Tarrgon: Please implement the hard-ban here :3
|
||||
}
|
||||
}
|
||||
|
||||
export default new HardBanCommand('hardban');
|
||||
Reference in New Issue
Block a user