<commit_before>package com.serebit.autotitan.extensions

import com.serebit.autotitan.Locale
import com.serebit.autotitan.annotations.CommandFunction
import net.dv8tion.jda.core.Permission
import net.dv8tion.jda.core.entities.Member
import net.dv8tion.jda.core.entities.User
import net.dv8tion.jda.core.events.message.MessageReceivedEvent

class Moderation {
  @CommandFunction(
      description = "Kicks a member from the current server.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.KICK_MEMBERS)
  )
  fun kick(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.kick(member).queue({
      evt.channel.sendMessage("Kicked.").queue()
    })
  }
  
  @CommandFunction(
      description = "Kicks a member from the server and deletes 1 day's worth of their messages.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun softBan(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.ban(member, 1).queue({
      evt.guild.controller.unban(member.user).queue({
        evt.channel.sendMessage("Softbanned.").queue()
      }
    }
  }

  @CommandFunction(
      description = "Bans a member from the current server.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun ban(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.ban(member, 0).queue({
      evt.channel.sendMessage("Banned.").queue()
    })
  }
  
  @CommandFunction(
      description = "Bans a member from the current server, and deletes 7 days worth of their messages.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun hardBan(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.ban(member, 7).queue({
      evt.channel.sendMessage("Banned.").queue()
    })
  }
  
  @CommandFunction(
      description = "Unbans a banned user from the current server.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun unBan(evt: MessageReceivedEvent, user: User) {
    evt.guild.controller.unban(user).queue({
      evt.channel.sendMessage("Unbanned.").queue()
    })
  }

  @CommandFunction(
      description = "Deletes the last N messages in the channel. N must be in the range of 1..99.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.MESSAGE_MANAGE)
  )
  fun cleanUp(evt: MessageReceivedEvent, number: Int) {
    if (number in (1..99)) {
      evt.textChannel.history.retrievePast(number + 1).queue({
        evt.textChannel.deleteMessages(it).queue()
      })
    }
  }
}<commit_msg>Fixed two syntax errors in Moderation#softBan.<commit_after>package com.serebit.autotitan.extensions

import com.serebit.autotitan.Locale
import com.serebit.autotitan.annotations.CommandFunction
import net.dv8tion.jda.core.Permission
import net.dv8tion.jda.core.entities.Member
import net.dv8tion.jda.core.entities.User
import net.dv8tion.jda.core.events.message.MessageReceivedEvent

class Moderation {
  @CommandFunction(
      description = "Kicks a member from the current server.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.KICK_MEMBERS)
  )
  fun kick(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.kick(member).queue({
      evt.channel.sendMessage("Kicked.").queue()
    })
  }
  
  @CommandFunction(
      description = "Kicks a member from the server and deletes 1 day's worth of their messages.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun softBan(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.ban(member, 1).queue({
      evt.guild.controller.unban(member.user).queue({
        evt.channel.sendMessage("Softbanned.").queue()
      })
    })
  }

  @CommandFunction(
      description = "Bans a member from the current server.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun ban(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.ban(member, 0).queue({
      evt.channel.sendMessage("Banned.").queue()
    })
  }
  
  @CommandFunction(
      description = "Bans a member from the current server, and deletes 7 days worth of their messages.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun hardBan(evt: MessageReceivedEvent, member: Member) {
    evt.guild.controller.ban(member, 7).queue({
      evt.channel.sendMessage("Banned.").queue()
    })
  }
  
  @CommandFunction(
      description = "Unbans a banned user from the current server.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.BAN_MEMBERS)
  )
  fun unBan(evt: MessageReceivedEvent, user: User) {
    evt.guild.controller.unban(user).queue({
      evt.channel.sendMessage("Unbanned.").queue()
    })
  }

  @CommandFunction(
      description = "Deletes the last N messages in the channel. N must be in the range of 1..99.",
      locale = Locale.GUILD,
      permissions = arrayOf(Permission.MESSAGE_MANAGE)
  )
  fun cleanUp(evt: MessageReceivedEvent, number: Int) {
    if (number in (1..99)) {
      evt.textChannel.history.retrievePast(number + 1).queue({
        evt.textChannel.deleteMessages(it).queue()
      })
    }
  }
}
{'fraction_non_alphanumeric': 0.11829383886255924, 'fraction_numerical': 0.006066350710900474, 'mean_word_length': 3.3495465787304206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4822001', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1692, 'n_words': 345}