<commit_before>package rollBot;

import com.darichey.discord.Command;
import com.darichey.discord.CommandListener;
import com.darichey.discord.CommandRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.commons.cli.*;
import sx.blah.discord.api.*;
import sx.blah.discord.api.events.EventDispatcher;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Main {
    private static final String DEFAULT_COMMAND_PREFIX = "/";
    private static Logger logger = LoggerFactory.getLogger(Main.class);
    private static Options options = populateOptions();

    public static void main(String[] args) {
        logger.info("Starting bot...");

        String token = "";

        try {
            CommandLineParser parser = new DefaultParser();
            CommandLine cmd = parser.parse(options, args);

            if (cmd.hasOption("t")) {
                token = cmd.getOptionValue("t");
            } else if (cmd.hasOption("f")) {
                try (BufferedReader fileReader
                             = new BufferedReader(new FileReader(cmd.getOptionValue("f")))) {
                    token = fileReader.readLine();
                } catch (IOException e) {
                    exitWithErrorMessage("There was an error attempting to read the given file...", e);
                }
            } else {
                printUsage();
                System.exit(0);
            }
        } catch (ParseException e){
            exitWithErrorMessage("There was an error attempting to parse the command line arguments...", e);
        }

        logger.info("Creating client with token {}", token);
        IDiscordClient client =  BotUtils.getBuiltDiscordClient(token);
        EventDispatcher dispatcher = client.getDispatcher();
        //dispatcher.registerListener(new InterfaceListener());
        //dispatcher.registerListener(new AnnotationListener());

        CommandRegistry registry = createCommandRegistry();
        CommandListener cmdListener = new CommandListener(registry);
        dispatcher.registerListener(cmdListener);

        client.login();
    }

    private static CommandRegistry createCommandRegistry() {
        CommandRegistry registry = new CommandRegistry(DEFAULT_COMMAND_PREFIX);
        populateCommandRegistry(registry);
        return registry;
    }

    private static void populateCommandRegistry(CommandRegistry registry) {
        Command ping = Command.builder()
                .onCalled(new PingCommand())
                .build();

        registry.register(ping, PingCommand.COMMAND_NAME);

        Command roll = Command.builder()
                .onCalled(new RollCommand())
                .build();

        registry.register(roll, RollCommand.COMMAND_NAME);

        Command coin = Command.builder()
                .onCalled(new CoinFlipCommand())
                .build();

        registry.register(coin, CoinFlipCommand.COMMAND_NAME);
    }

    private static Options populateOptions() {
        Options options = new Options();

        options.addOption("t", "token", true, "Bot token string.");
        options.addOption("f", "file", true, "Path to a file containing the bot token string.");

        return options;
    }

    private static void exitWithErrorMessage(String message, Exception e) {
        logger.error(message, e);
        logger.error("Exiting.");
        System.exit(1);
    }

    private static void printUsage() {
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp( "diceDiscordBot", options );
    }
}
<commit_msg>Added Ding command to command registry<commit_after>package rollBot;

import com.darichey.discord.Command;
import com.darichey.discord.CommandListener;
import com.darichey.discord.CommandRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.commons.cli.*;
import sx.blah.discord.api.*;
import sx.blah.discord.api.events.EventDispatcher;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Main {
    private static final String DEFAULT_COMMAND_PREFIX = "/";
    private static Logger logger = LoggerFactory.getLogger(Main.class);
    private static Options options = populateOptions();

    public static void main(String[] args) {
        logger.info("Starting bot...");

        String token = "";

        try {
            CommandLineParser parser = new DefaultParser();
            CommandLine cmd = parser.parse(options, args);

            if (cmd.hasOption("t")) {
                token = cmd.getOptionValue("t");
            } else if (cmd.hasOption("f")) {
                try (BufferedReader fileReader
                             = new BufferedReader(new FileReader(cmd.getOptionValue("f")))) {
                    token = fileReader.readLine();
                } catch (IOException e) {
                    exitWithErrorMessage("There was an error attempting to read the given file...", e);
                }
            } else {
                printUsage();
                System.exit(0);
            }
        } catch (ParseException e){
            exitWithErrorMessage("There was an error attempting to parse the command line arguments...", e);
        }

        logger.info("Creating client with token {}", token);
        IDiscordClient client =  BotUtils.getBuiltDiscordClient(token);
        EventDispatcher dispatcher = client.getDispatcher();
        //dispatcher.registerListener(new InterfaceListener());
        //dispatcher.registerListener(new AnnotationListener());

        CommandRegistry registry = createCommandRegistry();
        CommandListener cmdListener = new CommandListener(registry);
        dispatcher.registerListener(cmdListener);

        client.login();
    }

    private static CommandRegistry createCommandRegistry() {
        CommandRegistry registry = new CommandRegistry(DEFAULT_COMMAND_PREFIX);
        populateCommandRegistry(registry);
        return registry;
    }

    private static void populateCommandRegistry(CommandRegistry registry) {
        Command ping = Command.builder()
                .onCalled(new PingCommand())
                .build();

        registry.register(ping, PingCommand.COMMAND_NAME);
        
        Command ding = Command.builder()
                .oncCalled(new DingCommand())
                .build();
        
        registry.register(ding, DingCommand.COMMAND_NAME);
        
        Command roll = Command.builder()
                .onCalled(new RollCommand())
                .build();

        registry.register(roll, RollCommand.COMMAND_NAME);

        Command coin = Command.builder()
                .onCalled(new CoinFlipCommand())
                .build();

        registry.register(coin, CoinFlipCommand.COMMAND_NAME);
    }

    private static Options populateOptions() {
        Options options = new Options();

        options.addOption("t", "token", true, "Bot token string.");
        options.addOption("f", "file", true, "Path to a file containing the bot token string.");

        return options;
    }

    private static void exitWithErrorMessage(String message, Exception e) {
        logger.error(message, e);
        logger.error("Exiting.");
        System.exit(1);
    }

    private static void printUsage() {
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp( "diceDiscordBot", options );
    }
}

{'fraction_non_alphanumeric': 0.10275352585627938, 'fraction_numerical': 0.0010745466756212224, 'mean_word_length': 2.421875, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6590170', 'n_tokens_mistral': 1897, 'n_tokens_neox': 1822, 'n_words': 455}