```js
const { Client, Intents } = require('discord.js');

const client = new Client({
  intents: [Intents.FLAGS.GUILDS]
});

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('interactionCreate', async interaction => {
  if (!interaction.isCommand()) return;

  if (interaction.commandName === 'ban') {
    // Ban the user
    const user = interaction.options.getUser('user');
    await interaction.guild.members.ban(user);

    // Inform about successful ban
    interaction.reply(`${user.username} has been banned.`);
  }
});

client.login('your-token-here');

```
```js
const { Client, Intents } = require('discord.js');

const client = new Client({
  intents: [Intents.FLAGS.GUILDS]
});

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('interactionCreate', async interaction => {
  if (!interaction.isCommand()) return;

  if (interaction.commandName === 'ban') {
    // Ban the user
    const user = interaction.options.getUser('user');
    await interaction.guild.members.ban(user);

    // Inform about successful ban
    interaction.reply(`${user.username} has been banned.`);
  }
});

client.login('your-token-here');

```