<commit_before>package com.mrpowergamerbr.loritta.commands.vanilla.music

import com.mrpowergamerbr.loritta.commands.AbstractCommand
import com.mrpowergamerbr.loritta.commands.CommandContext
import com.mrpowergamerbr.loritta.network.Databases
import com.mrpowergamerbr.loritta.utils.Constants
import com.mrpowergamerbr.loritta.utils.LoriReply
import com.mrpowergamerbr.loritta.utils.locale.LegacyBaseLocale
import com.mrpowergamerbr.loritta.utils.loritta
import com.mrpowergamerbr.loritta.utils.save
import net.dv8tion.jda.core.Permission
import net.perfectdreams.loritta.api.commands.CommandCategory
import org.jetbrains.exposed.sql.transactions.transaction
import java.util.*

class VolumeCommand : AbstractCommand("volume", category = CommandCategory.MUSIC) {
	override fun getDescription(locale: LegacyBaseLocale): String {
		return locale.get("VOLUME_DESCRIPTION")
	}

	override fun getExamples(): List<String> {
		return Arrays.asList("100", "66", "33")
	}

	override fun getDiscordPermissions(): List<Permission> {
		return listOf(Permission.VOICE_MUTE_OTHERS)
	}

	override fun requiresMusicEnabled(): Boolean {
		return true
	}

	override fun canUseInPrivateChannel(): Boolean {
		return false
	}

	override suspend fun run(context: CommandContext,locale: LegacyBaseLocale) {
		val serverConfig = loritta.getOrCreateServerConfig(context.guild.idLong)

		val donationKey = transaction(Databases.loritta) {
			serverConfig.donationKey
		}

		val donatedMoney = loritta.getActiveMoneyFromDonations(context.userHandle.idLong)

		if ((donationKey == null || !donationKey.isActive() || 19.99 > donationKey.value) || 19.99 > donatedMoney) {
			context.reply(
					locale["PREMIUM_CantUseFeature"],
					"\uD83D\uDCB8"
			)
			return
		}<commit_msg>Corrigir "+volume" para servidores que possuem keys ativadas, mas o usuário não é doador<commit_after>package com.mrpowergamerbr.loritta.commands.vanilla.music

import com.mrpowergamerbr.loritta.commands.AbstractCommand
import com.mrpowergamerbr.loritta.commands.CommandContext
import com.mrpowergamerbr.loritta.network.Databases
import com.mrpowergamerbr.loritta.utils.Constants
import com.mrpowergamerbr.loritta.utils.LoriReply
import com.mrpowergamerbr.loritta.utils.locale.LegacyBaseLocale
import com.mrpowergamerbr.loritta.utils.loritta
import com.mrpowergamerbr.loritta.utils.save
import net.dv8tion.jda.core.Permission
import net.perfectdreams.loritta.api.commands.CommandCategory
import org.jetbrains.exposed.sql.transactions.transaction
import java.util.*

class VolumeCommand : AbstractCommand("volume", category = CommandCategory.MUSIC) {
	override fun getDescription(locale: LegacyBaseLocale): String {
		return locale.get("VOLUME_DESCRIPTION")
	}

	override fun getExamples(): List<String> {
		return Arrays.asList("100", "66", "33")
	}

	override fun getDiscordPermissions(): List<Permission> {
		return listOf(Permission.VOICE_MUTE_OTHERS)
	}

	override fun requiresMusicEnabled(): Boolean {
		return true
	}

	override fun canUseInPrivateChannel(): Boolean {
		return false
	}

	override suspend fun run(context: CommandContext,locale: LegacyBaseLocale) {
		val serverConfig = loritta.getOrCreateServerConfig(context.guild.idLong)

		val donationKey = transaction(Databases.loritta) {
			serverConfig.donationKey
		}

		val donatedMoney = loritta.getActiveMoneyFromDonations(context.userHandle.idLong)

		if ((donationKey == null || !donationKey.isActive() || 19.99 > donationKey.value) && 19.99 > donatedMoney) {
			context.reply(
					locale["PREMIUM_CantUseFeature"],
					"\uD83D\uDCB8"
			)
			return
		}
{'fraction_non_alphanumeric': 0.09958041958041958, 'fraction_numerical': 0.01062937062937063, 'mean_word_length': 5.7727272727272725, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '1119574', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1118, 'n_words': 197}