<commit_before>﻿using Meebey.SmartIrc4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace PegBot.Plugins
{
    class RandomPlugin : BotPlugin
    {
        Random rnd;
        public RandomPlugin(IrcClient irc)
            : base(irc, "random")
        {
            rnd = new Random();
            RegisterCommand(".roll", "[max]", "Roll a random number between 1 and 100 or [max]", OnRoll, arg => String.IsNullOrEmpty(arg) || Regex.IsMatch(arg, @"^\d+$"), false);
            RegisterCommand(".magic8ball", "<question>", "Ask question to the magic 8 ball", OnMagic, false);
        }

        private void OnRoll(string arg, string channel, string nick, string replyTo)
        {
            int roll = String.IsNullOrEmpty(arg) ? rnd.Next(100) + 1 : rnd.Next(Int32.Parse(arg)) + 1; //they see me rollin
            irc.SendMessage(SendType.Message, replyTo, nick + ": " + roll);
        }

        private void OnMagic(string arg, string channel, string nick, string replyTo)
        {
            string[] anwsers = {
                "It is certain",
                "It is decidedly so",
                "Without a doubt",
                "Yes definitely",
                "You may rely on it",
                "As I see it, yes",
                "Most likely",
                "Outlook good",
                "Yes",
                "Signs point to yes",
                "Reply hazy try again",
                "Ask again later",
                "Better not tell you now",
                "Cannot predict now",
                "Concentrate and ask again",
                "Don't count on it",
                "My reply is no",
                "My sources say no",
                "Outlook not so good",
                "Very doubtful"};
            irc.SendMessage(SendType.Message, replyTo, nick + ": " + anwsers[rnd.Next(anwsers.Length)]);
        }
    }
}<commit_msg>Changed magic8ball so it prints to channel instead of source<commit_after>﻿using Meebey.SmartIrc4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace PegBot.Plugins
{
    class RandomPlugin : BotPlugin
    {
        Random rnd;
        public RandomPlugin(IrcClient irc)
            : base(irc, "random")
        {
            rnd = new Random();
            RegisterCommand(".roll", "[max]", "Roll a random number between 1 and 100 or [max]", OnRoll, arg => String.IsNullOrEmpty(arg) || Regex.IsMatch(arg, @"^\d+$"), false);
            RegisterCommand(".magic8ball", "<question>", "Ask question to the magic 8 ball", OnMagic, false);
        }

        private void OnRoll(string arg, string channel, string nick, string replyTo)
        {
            int roll = String.IsNullOrEmpty(arg) ? rnd.Next(100) + 1 : rnd.Next(Int32.Parse(arg)) + 1; //they see me rollin
            irc.SendMessage(SendType.Message, replyTo, nick + ": " + roll);
        }

        private void OnMagic(string arg, string channel, string nick, string replyTo)
        {
            string[] anwsers = {
                "It is certain",
                "It is decidedly so",
                "Without a doubt",
                "Yes definitely",
                "You may rely on it",
                "As I see it, yes",
                "Most likely",
                "Outlook good",
                "Yes",
                "Signs point to yes",
                "Reply hazy try again",
                "Ask again later",
                "Better not tell you now",
                "Cannot predict now",
                "Concentrate and ask again",
                "Don't count on it",
                "My reply is no",
                "My sources say no",
                "Outlook not so good",
                "Very doubtful"};
            irc.SendMessage(SendType.Message, channel, nick + ": " + arg + " - " + anwsers[rnd.Next(anwsers.Length)]);
        }
    }
}
{'fraction_non_alphanumeric': 0.11237342553716967, 'fraction_numerical': 0.0071622622869844405, 'mean_word_length': 1.7272727272727273, 'pattern_counts': {'":': 4, '<': 5, '<?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': '4713814', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1079, 'n_words': 346}