<commit_before>package com.cobble.bot.common.api.commands

import javax.naming.ConfigurationException

import com.cobble.bot.common.DefaultLang
import com.cobble.bot.common.api.{Command, PermissionLevel, TwitchChannelInfo}
import com.cobble.bot.common.api.PermissionLevel.PermissionLevel
import com.cobble.bot.common.util.TwitchApiUtil
import play.api.i18n.MessagesApi

import scala.concurrent.{ExecutionContext, Future}

trait SubCountCommand extends Command with DefaultLang {

    override val name: String = "count"

    override val permissionLevel: PermissionLevel = PermissionLevel.MODERATORS

    def getTotalSubCount(twitchChannelInfo: Option[TwitchChannelInfo], twitchApiUtil: TwitchApiUtil)(implicit executionContext: ExecutionContext, messagesApi: MessagesApi): Future[Int] = {
        if (twitchChannelInfo.isDefined)
            if (twitchChannelInfo.get.oauth.isDefined)
                if (twitchChannelInfo.get.channelId.isDefined)
                    twitchApiUtil.channelSubscriptionsRequest(twitchChannelInfo.get).get().map(response => (response.json \ "_total").as[Int])
                else
                    Future.failed(new ConfigurationException(messagesApi("error.twitch.missing.channelId")))
            else
                Future.failed(new ConfigurationException(messagesApi("error.twitch.missing.oauth")))
        else
            Future.failed(new ConfigurationException(messagesApi("error.twitch.channelDoesNotExist")))
    }

}<commit_msg>Fixed the sub count command so that it does not include the channel user<commit_after>package com.cobble.bot.common.api.commands

import javax.naming.ConfigurationException

import com.cobble.bot.common.DefaultLang
import com.cobble.bot.common.api.{Command, PermissionLevel, TwitchChannelInfo}
import com.cobble.bot.common.api.PermissionLevel.PermissionLevel
import com.cobble.bot.common.util.TwitchApiUtil
import play.api.i18n.MessagesApi

import scala.concurrent.{ExecutionContext, Future}

trait SubCountCommand extends Command with DefaultLang {

    override val name: String = "count"

    override val permissionLevel: PermissionLevel = PermissionLevel.MODERATORS

    def getTotalSubCount(twitchChannelInfo: Option[TwitchChannelInfo], twitchApiUtil: TwitchApiUtil)(implicit executionContext: ExecutionContext, messagesApi: MessagesApi): Future[Int] = {
        if (twitchChannelInfo.isDefined)
            if (twitchChannelInfo.get.oauth.isDefined)
                if (twitchChannelInfo.get.channelId.isDefined)
                    twitchApiUtil.channelSubscriptionsRequest(twitchChannelInfo.get).get().map(response => (response.json \ "_total").as[Int] - 1) // Subtract 1 because Twitch counts the twitch channel user as a sub.
                else
                    Future.failed(new ConfigurationException(messagesApi("error.twitch.missing.channelId")))
            else
                Future.failed(new ConfigurationException(messagesApi("error.twitch.missing.oauth")))
        else
            Future.failed(new ConfigurationException(messagesApi("error.twitch.channelDoesNotExist")))
    }

}
{'fraction_non_alphanumeric': 0.09076175040518639, 'fraction_numerical': 0.0019448946515397082, 'mean_word_length': 3.98546042003231, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2017824', 'n_tokens_mistral': 860, 'n_tokens_neox': 836, 'n_words': 152}