<commit_before>import TargetSelector from './../../lib/util/target-selector'
import Responder from './../../lib/messages/responder.js'
import { bot } from './../../lib/index.js'

const info = {
  name: 'kick',
  args: '<Username | Userid | User Mention> - target selector capable',
  description: 'kicks someone from the server'
}

async function action (msg, args) {
  var responder = new Responder(msg.channel)

  if (!msg.member.permission.has('kickMembers')) {
    responder.error('You need the "(kickMembers)" permission for that.')
    return
  }

  var targetSelector = new TargetSelector()

  if (args.length === 0) {
    return 'Specify an user'
  }

  var member = await targetSelector.find(msg, args[0])

  // Prompt cancelled
  if (member === false) {
    return
  }

  if (!member) {
    responder.error('User not found')
  } else {
    responder.success(`User ${member.user.username}#${member.user.discriminator} ( ${member.user.id} ) was kicked from the server`)
  }

  responder.send()
}

function register () {
  bot.registerCommand(info.name, action, info)
}

export default {
  info,
  register
}<commit_msg>Kick cmd now kicks the user<commit_after>import TargetSelector from './../../lib/util/target-selector'
import Responder from './../../lib/messages/responder.js'
import { bot } from './../../lib/index.js'

const info = {
  name: 'kick',
  args: '<Username | Userid | User Mention> [Reason] - target selector capable',
  description: 'kicks someone from the server'
}

async function action (msg, args) {
  const responder = new Responder(msg.channel)

  if (!msg.member.permission.has('kickMembers')) {
    responder.error('You need the "(kickMembers)" permission for that.')
    return
  }

  const targetSelector = new TargetSelector()

  if (args.length === 0) {
    return 'Specify an user'
  }

  let member = await targetSelector.find(msg, args[0])
  const reason = args[1] || ''
  // Prompt cancelled
  if (member === false) {
    return
  }

  if (!member) {
    responder.error('User not found')
  } else {
    try {
      await member.kick(reason)
      responder.success(`User ${member.user.username}#${member.user.discriminator} ( ${member.user.id} ) was kicked from the server`)
    } catch (e) {
      const error = JSON.parse(e.response)

      responder.error(`Failed with error: ${error.code} - ${error.message} `)
    }
  }

  responder.send()
}

function register () {
  bot.registerCommand(info.name, action, info)
}

export default {
  info,
  register
}
{'fraction_non_alphanumeric': 0.15353858456617353, 'fraction_numerical': 0.001999200319872051, 'mean_word_length': 3.2696245733788394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7427451', 'n_tokens_mistral': 804, 'n_tokens_neox': 775, 'n_words': 212}