<commit_before>package net.dirtydeeds.discordsoundboard.chat;

import net.dirtydeeds.discordsoundboard.service.SoundboardBot;
import net.dirtydeeds.discordsoundboard.beans.SoundFile;
import net.dirtydeeds.discordsoundboard.utils.Strings;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

public class SetEntranceProcessor extends SingleArgumentChatCommandProcessor {

	private static final int WARNING_DURATION_IN_SECONDS = 5;
	private static final int MAX_DURATION_IN_SECONDS = 8;

	public SetEntranceProcessor(String prefix, SoundboardBot bot) {
		super(prefix, "Entrance", bot);
	}

	protected void handleEvent(MessageReceivedEvent event, String message) {
		String fileName = getArgument();
		if (bot.isAllowedToPlaySound(event.getAuthor())) {
			if (fileName == null) {
				bot.setEntranceForUser(event.getAuthor(), null, null);
				pm(event, "Cleared your entrance.");
			} else if (bot.getSoundMap().get(fileName) == null) {
				pm(event, lookupString(Strings.SOUND_NOT_FOUND));
			}
			SoundFile file = bot.getSoundMap().get(fileName);
			boolean authenticated = bot.isAuthenticated(event.getAuthor(),
			                        event.getGuild());
			if (!authenticated && file.getDuration() != null &&
			    file.getDuration() > MAX_DURATION_IN_SECONDS) {
				pm(event, "The file `" + fileName +
				   "` is far too **long**! *Pick something shorter*.");
				return;
			}
			bot.setEntranceForUser(event.getAuthor(), fileName, null);
			pm(event, "Updated your entrance to sound file `" + fileName + "`!");
			if (file.getDuration() > WARNING_DURATION_IN_SECONDS) {
				pm(event, "The file `" + fileName + "` may be a bit **long**. "
				   + "*Be careful of setting very long entrances!*");
			}
		}
	}

	@Override
	public String getCommandHelpString() {<commit_msg>Notice me, Senpai.<commit_after>package net.dirtydeeds.discordsoundboard.chat;

import net.dirtydeeds.discordsoundboard.service.SoundboardBot;
import net.dirtydeeds.discordsoundboard.beans.SoundFile;
import net.dirtydeeds.discordsoundboard.utils.Strings;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

public class SetEntranceProcessor extends SingleArgumentChatCommandProcessor {

	private static final int WARNING_DURATION_IN_SECONDS = 5;
	private static final int MAX_DURATION_IN_SECONDS = 8;

	public SetEntranceProcessor(String prefix, SoundboardBot bot) {
		super(prefix, "Entrance", bot);
	}

	protected void handleEvent(MessageReceivedEvent event, String message) {
		String fileName = getArgument();
		if (bot.isAllowedToPlaySound(event.getAuthor())) {
			if (fileName == null) {
				bot.setEntranceForUser(event.getAuthor(), null, null);
				pm(event, "Cleared your entrance.");
				return;
			} 
			SoundFile file = bot.getSoundMap().get(fileName);
			if (file == null) {
				pm(event, lookupString(Strings.SOUND_NOT_FOUND));
				return;
			}
			boolean authenticated = bot.isAuthenticated(event.getAuthor(),
			                        event.getGuild());
			if (!authenticated && file.getDuration() != null &&
			    file.getDuration() > MAX_DURATION_IN_SECONDS) {
				pm(event, "The file `" + fileName +
				   "` is far too **long**! *Pick something shorter*.");
				return;
			}
			bot.setEntranceForUser(event.getAuthor(), fileName, null);
			pm(event, "Updated your entrance to sound file `" + fileName + "`!");
			if (file.getDuration() > WARNING_DURATION_IN_SECONDS) {
				pm(event, "The file `" + fileName + "` may be a bit **long**. "
				   + "*Be careful of setting very long entrances!*");
			}
		}
	}

	@Override
	public String getCommandHelpString() {
{'fraction_non_alphanumeric': 0.12315408191696851, 'fraction_numerical': 0.0016717748676511562, 'mean_word_length': 4.318518518518519, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1376185', 'n_tokens_mistral': 1276, 'n_tokens_neox': 1131, 'n_words': 245}