<commit_before>﻿using Discord;
using Discord.Commands;
using Discord.Modules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Timers;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using System.Drawing.Imaging;
using Discord.Legacy;

namespace NadekoBot.Modules
{
    class Conversations : DiscordModule
    {
        private string firestr = "🔥 ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้ 🔥";
        public Conversations() : base()
        {
            commands.Add(new CopyCommand());
        }

        private CommandBuilder CreateCommand(CommandGroupBuilder cbg, string txt)
        {
            CommandBuilder cb = cbg.CreateCommand(txt);
            return cb;
        }

        private CommandBuilder AliasCommand(CommandBuilder cb, string txt) => cb.Alias(new string[] { "," + txt, "-" + txt });

        public override void Install(ModuleManager manager)
        {
            Random rng = new Random();

            manager.CreateCommands("", cgb =>
            {
                var client = manager.Client;

                cgb.CreateCommand("\\o\\")
                    .Description("Nadeko replies with /o/")
                    .Do(async e =>
                    {
                        await e.Send(e.User.Mention + "/o/");
                    });

                cgb.CreateCommand("/o/")
                    .Description("Nadeko replies with \\o\\")
                    .Do(async e =>
                    {
                        await e.Send( e.User.Mention + "\\o\\");
                    });
            });

            manager.CreateCommands(NadekoBot.botMention, cgb =>
            {
                var client = manager.Client;

                commands.ForEach(cmd => cmd.Init(cgb));

                CreateCommand(cgb, "uptime")
                    .Description("Shows how long is Nadeko running for.")
                    .Do(async e => {
                        var time = (DateTime.Now - Process.GetCurrentProcess().StartTime);
                        string str = "I am online for " + time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes.";
                        await e.Send(str);
                    });

                CreateCommand(cgb, "die")
                    .Description("Works only for the owner. Shuts the bot down.")
                    .Do(async e =>
                    {
                        if (e.User.Id == NadekoBot.OwnerID)
                        {
                            Timer t = new Timer();
                            t.Interval = 2000;
                            t.Elapsed += (s, ev) => { Environment.Exit(0); };
                            t.Start();
                            await e.Send(e.User.Mention + ", Yes, my love.");
                        }
                        else
                            await e.Send(e.User.Mention + ", No.");
                    });

                Stopwatch randServerSW = new Stopwatch();
                randServerSW.Start();

                cgb.CreateCommand("randserver")
                    .Description("Generates an invite to a random server and prints some stats.")
                    .Do(async e => {
                        if (randServerSW.ElapsedMilliseconds / 1000 < 1800) {
                            await e.Send("You have to wait " + (1800 - randServerSW.ElapsedMilliseconds / 1000) + " more seconds to use this function.");
                            return;
                        }
                        randServerSW.Reset();
                        while (true) {
                            var server = client.Servers.OrderBy(x => rng.Next()).FirstOrDefault();
                            if (server == null)
                                continue;
                            try {
                                var inv = await server.CreateInvite(100, 5);
                                await e.Send("**Server:** " + server.Name +
                                            "\n**Owner:** " + server.Owner.Name +
                                            "\n**Channels:** " + server.AllChannels.Count() +
                                            "\n**Total Members:** " + server.Users.Count() +
                                            "\n**Online Members:** " + server.Users.Where(u => u.Status == UserStatus.Online).Count() +
                                            "\n**Invite:** " + inv.Url);
                                break;
                            } catch (Exception) { continue; }
                        }
                    });


                CreateCommand(cgb, "do you love me")
                    .Description("Replies with positive answer only to the bot owner.")
                    .Do(async e => {
                        if (e.User.Id == NadekoBot.OwnerID)
                            await e.Send(e.User.Mention + ", Of course I do, my Master.");
                        else
                            await e.Send(e.User.Mention + ", Don't be silly.");
                    });

                CreateCommand(cgb, "how are you")
                    .Description("Replies positive only if bot owner is online.")
                    .Do(async e =>
                    {
                        if (e.User.Id == NadekoBot.OwnerID)
                        {
                            await e.Send(e.User.Mention + " I am great as long as you are here.");
                        }
                        else
                        {
                            var kw = e.Server.GetUser(NadekoBot.OwnerID);
                            if (kw != null && kw.Status == UserStatus.Online)
                            {
                                await e.Send(e.User.Mention + " I am great as long as " + kw.Mention + " is with me.");
                            }
                            else
                            {
                                await e.Send(e.User.Mention + " I am sad. My Master is not with me.");<commit_msg>troll command,commented out to prevent abuse<commit_after>﻿using Discord;
using Discord.Commands;
using Discord.Modules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Timers;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using System.Drawing.Imaging;
using Discord.Legacy;

namespace NadekoBot.Modules
{
    class Conversations : DiscordModule
    {
        private string firestr = "🔥 ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้ 🔥";
        public Conversations() : base()
        {
            commands.Add(new CopyCommand());
        }

        private CommandBuilder CreateCommand(CommandGroupBuilder cbg, string txt)
        {
            CommandBuilder cb = cbg.CreateCommand(txt);
            return cb;
        }

        private CommandBuilder AliasCommand(CommandBuilder cb, string txt) => cb.Alias(new string[] { "," + txt, "-" + txt });

        public override void Install(ModuleManager manager)
        {
            Random rng = new Random();

            manager.CreateCommands("", cgb =>
            {
                var client = manager.Client;

                cgb.CreateCommand("\\o\\")
                    .Description("Nadeko replies with /o/")
                    .Do(async e =>
                    {
                        await e.Send(e.User.Mention + "/o/");
                    });

                cgb.CreateCommand("/o/")
                    .Description("Nadeko replies with \\o\\")
                    .Do(async e =>
                    {
                        await e.Send( e.User.Mention + "\\o\\");
                    });
            });

            manager.CreateCommands(NadekoBot.botMention, cgb =>
            {
                var client = manager.Client;

                commands.ForEach(cmd => cmd.Init(cgb));

                CreateCommand(cgb, "uptime")
                    .Description("Shows how long is Nadeko running for.")
                    .Do(async e => {
                        var time = (DateTime.Now - Process.GetCurrentProcess().StartTime);
                        string str = "I am online for " + time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes.";
                        await e.Send(str);
                    });

                CreateCommand(cgb, "die")
                    .Description("Works only for the owner. Shuts the bot down.")
                    .Do(async e =>
                    {
                        if (e.User.Id == NadekoBot.OwnerID)
                        {
                            Timer t = new Timer();
                            t.Interval = 2000;
                            t.Elapsed += (s, ev) => { Environment.Exit(0); };
                            t.Start();
                            await e.Send(e.User.Mention + ", Yes, my love.");
                        }
                        else
                            await e.Send(e.User.Mention + ", No.");
                    });

                Stopwatch randServerSW = new Stopwatch();
                randServerSW.Start();

                cgb.CreateCommand("randserver")
                    .Description("Generates an invite to a random server and prints some stats.")
                    .Do(async e => {
                        if (randServerSW.ElapsedMilliseconds / 1000 < 1800) {
                            await e.Send("You have to wait " + (1800 - randServerSW.ElapsedMilliseconds / 1000) + " more seconds to use this function.");
                            return;
                        }
                        randServerSW.Reset();
                        while (true) {
                            var server = client.Servers.OrderBy(x => rng.Next()).FirstOrDefault();
                            if (server == null)
                                continue;
                            try {
                                var inv = await server.CreateInvite(100, 5);
                                await e.Send("**Server:** " + server.Name +
                                            "\n**Owner:** " + server.Owner.Name +
                                            "\n**Channels:** " + server.AllChannels.Count() +
                                            "\n**Total Members:** " + server.Users.Count() +
                                            "\n**Online Members:** " + server.Users.Where(u => u.Status == UserStatus.Online).Count() +
                                            "\n**Invite:** " + inv.Url);
                                break;
                            } catch (Exception) { continue; }
                        }
                    });
                /*
                cgb.CreateCommand("avalanche!")
                    .Description("Mentions a person in every channel of the server, then deletes it")
                    .Parameter("name", ParameterType.Required)
                    .Do(e => {
                        var usr = e.Server.FindUsers(e.GetArg("name")).FirstOrDefault();
                        if (usr == null) return;
                        e.Server.AllChannels.ForEach(async c => {
                            try {
                                var m = await c.SendMessage(usr.Mention);
                                await m.Delete();
                            } catch (Exception ex) {
                                Console.WriteLine(ex);
                            }
                        });
                    });
                    */
                CreateCommand(cgb, "do you love me")
                    .Description("Replies with positive answer only to the bot owner.")
                    .Do(async e => {
                        if (e.User.Id == NadekoBot.OwnerID)
                            await e.Send(e.User.Mention + ", Of course I do, my Master.");
                        else
                            await e.Send(e.User.Mention + ", Don't be silly.");
                    });

                CreateCommand(cgb, "how are you")
                    .Description("Replies positive only if bot owner is online.")
                    .Do(async e =>
                    {
                        if (e.User.Id == NadekoBot.OwnerID)
                        {
                            await e.Send(e.User.Mention + " I am great as long as you are here.");
                        }
                        else
                        {
                            var kw = e.Server.GetUser(NadekoBot.OwnerID);
                            if (kw != null && kw.Status == UserStatus.Online)
                            {
                                await e.Send(e.User.Mention + " I am great as long as " + kw.Mention + " is with me.");
                            }
                            else
                            {
                                await e.Send(e.User.Mention + " I am sad. My Master is not with me.");
{'fraction_non_alphanumeric': 0.12504728042968455, 'fraction_numerical': 0.0037824343747635976, 'mean_word_length': 1.0167810831426392, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 25, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3726315', 'n_tokens_mistral': 3423, 'n_tokens_neox': 3359, 'n_words': 726}