Ejemplo n.º 1
0
        public async Task SetBirthdayrole(string role = null)
        {
            var guildAccount = ServerAccounts.GetServerAccount(Context.Guild);

            if (role != null)
            {
                var list = Context.Guild.Roles.SingleOrDefault(x => string.Equals(x.Name, role, StringComparison.CurrentCultureIgnoreCase));
                if (list != null)
                {
                    guildAccount.BirthdayRoleId = list.Id;
                    ServerAccounts.SaveServerAccounts();
                    await CommandHandeling.ReplyAsync(Context, $"Birthday role set! ({list.Name})");
                }
                else
                {
                    await CommandHandeling.ReplyAsync(Context, "No such role found");

                    return;
                }
            }

            if (role == null)
            {
                var change = await Context.Guild.CreateRoleAsync($"🍰",
                                                                 new GuildPermissions(), Color.Gold, true, RequestOptions.Default);

                await change.ModifyAsync(p => p.Position = 2);

                guildAccount.BirthdayRoleId = change.Id;
                ServerAccounts.SaveServerAccounts();
                await CommandHandeling.ReplyAsync(Context, $"We have creatyed and set Birthday role! ({change.Name})");
            }
        }
Ejemplo n.º 2
0
        public async Task Perfectus()
        {
            if (Context.User.Id == 129658526460149760)
            {
                const string url         = "https://i.imgur.com/mKxhNAY.jpg";
                var          color1      = new Random();
                var          color2      = new Random();
                var          color3      = new Random();
                var          color1Index = color1.Next(256);
                var          color2Index = color2.Next(256);
                var          color3Index = color3.Next(256);

                var embed = new EmbedBuilder();
                embed.WithColor(color1Index, color2Index, color3Index);

                embed.WithImageUrl("" + url);

                await CommandHandeling.ReplyAsync(Context, embed);
            }
            else
            {
                var embed = new EmbedBuilder();
                embed.WithImageUrl("https://i.imgur.com/wt8EN8R.jpg");

                await CommandHandeling.ReplyAsync(Context, embed);
            }
        }
Ejemplo n.º 3
0
        public async Task WriteFuckt(IGuildUser user, [Remainder] string message)
        {
            try
            {
                var account = UserAccounts.GetAccount((SocketUser)user, Context.Guild.Id);
                if (account == null)
                {
                    return;
                }

                account.Fuckt += message + "|";
                UserAccounts.SaveAccounts(Context.Guild.Id);
                var id = Context.Message.Id;


                var msg = await Context.Channel.GetMessageAsync(id);

                await msg.DeleteAsync();


                await CommandHandeling.ReplyAsync(Context,
                                                  $"We wrote down this fact about {user.Mention}!");
            }
            catch
            {
                //   await ReplyAsync(
                //       "boo... An error just appear >_< \nTry to use this command properly: **fact [user_ping(or user ID)] [message]**(write down a fact about user!)\n" +
                //       "Alias: факт, write, fact, write down");
            }
        }
Ejemplo n.º 4
0
        public async Task JsonDel(int index)
        {
            var mylorikGlobal = Global.Client.GetUser(181514288278536193);
            var mylorik       = UserAccounts.GetAccount(mylorikGlobal, 0);
            var keyName       =
                mylorik.KeyPullName.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
            var keykey =
                mylorik.KeyPullKey.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);


            mylorik.KeyPullName = null;
            mylorik.KeyPullKey  = null;
            for (var i = 0; i < keyName.Length; i++)
            {
                if (i != index)
                {
                    mylorik.KeyPullName += $"{keyName[i]}|";
                    mylorik.KeyPullKey  += $"{keykey[i]}|";
                }
            }


            await CommandHandeling.ReplyAsync(Context,
                                              $"ключ **{keyName[index]} {keykey[index]}** был удалён");

            UserAccounts.SaveAccounts(0);
        }
Ejemplo n.º 5
0
        public async Task TopByOctoPoints(int page = 1)
        {
            try
            {
                if (page < 1)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      "Boole! Try different page <_<");

                    return;
                }

                var currentGuildUsersId = Context.Guild.Users.Select(user => user.Id);
                var accounts            =
                    UserAccounts.GetFilteredAccounts(acc => currentGuildUsersId.Contains(acc.Id), Context.Guild.Id);

                const int usersPerPage = 9;

                var lastPage = 1 + accounts.Count / (usersPerPage + 1);
                if (page > lastPage)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      $"Boole. Last Page is {lastPage}");

                    return;
                }

                var ordered = accounts.OrderByDescending(acc => acc.Points).ToList();

                var embB = new EmbedBuilder()
                           .WithTitle("Top By Octo Points:")
                           .WithFooter(
                    $"Page {page}/{lastPage} ● Say \"topp 2\" to see second page (you can edit previous message)");


                page--;
                for (var j = 0; j < ordered.Count; j++)
                {
                    if (ordered[j].Id == Context.User.Id)
                    {
                        embB.WithDescription(
                            $"**#{j + usersPerPage * page + 1} {Context.User.Username} {ordered[j].Points} OctoPoints**\n**______**");
                    }
                }

                for (var i = 1; i <= usersPerPage && i + usersPerPage * page <= ordered.Count; i++)
                {
                    var account = ordered[i - 1 + usersPerPage * page];
                    var user    = Global.Client.GetUser(account.Id);
                    embB.AddField($"#{i + usersPerPage * page} {user.Username}", $"{account.Points} OctoPoints", true);
                }

                await CommandHandeling.ReplyAsync(Context, embB);
            }
            catch
            {
                //   await ReplyAsync(
                //       "boo... An error just appear >_< \nTry to use this command properly: **topp [page_number]**(Top By Activity)\nAlias: topo");
            }
        }
Ejemplo n.º 6
0
        public async Task HelpPass()
        {
            var embed = new EmbedBuilder();


            embed.AddField("Система допусков(пассов)", "Пропуски дают больше привилегий у осьминожек!\n" +
                           "**пасс** или **pass** Чтобы купить пропуск (бот у вас переспросит, так что он не сразу снимает поинты)\n" +
                           " \n" +
                           "**Доступ #1**\n" +
                           "**octo [индекс]** показать осьминожку под индексом\n**GiftPoints [username] [points]** Передать свои поинты другому с 10% комиссией\n" +
                           " \n" +
                           "**Доступ #2**\n" +
                           "**ВсеФакты** покажет ваши все факты\n**УдалитьФакт [индекс]** Удалит определенный факт\n" +
                           " \n" +
                           "**Доступ #3**\n" +
                           "**факт [имя] [индекс]** Показать факт о юзере под индексом\n" +
                           " \n" +
                           "**Доступ #4**\n" +
                           "**ВсеФакты [имя]** покажет все факты юзера\n**stats [имя]** Статистика юзверя и все его варны, кики, баны и другие засгули\n" +
                           " \n" +
                           "**Доступ #100**\n" +
                           $"**осьминожка** {new Emoji("🐙")}");


            embed.WithFooter("lil octo notebook");
            embed.WithColor(Color.LightOrange);

            await CommandHandeling.ReplyAsync(Context, embed);
        }
Ejemplo n.º 7
0
        public async Task Restart(string cmd)
        {
            if (Context.User.Id != 181514288278536193 || Context.User.Id != 238337696316129280)
            {
                await CommandHandeling.ReplyAsync(Context,
                                                  "no.");

                return;
            }

            var escapedArgs = cmd.Replace("\"", "\\\"");

            var process = new Process()
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName  = "/bin/bash",
                    Arguments = $"-c \"{escapedArgs}\"",
                    RedirectStandardOutput = true,
                    UseShellExecute        = false,
                    CreateNoWindow         = true,
                }
            };

            process.Start();
            string result = process.StandardOutput.ReadToEnd();

            process.WaitForExit();
            await CommandHandeling.ReplyAsync(Context,
                                              $"{result}");
        }
Ejemplo n.º 8
0
        public async Task TeninzRole(SocketUser user, string role)
        {
            var check    = Context.User as IGuildUser;
            var comander = UserAccounts.GetAccount(Context.User, Context.Guild.Id);

            if (check != null && (comander.OctoPass >= 100 || comander.IsModerator >= 1 ||
                                  check.GuildPermissions.ManageRoles ||
                                  check.GuildPermissions.ManageMessages))
            {
                var guildUser  = Global.Client.GetGuild(Context.Guild.Id).GetUser(user.Id);
                var roleToGive = Global.Client.GetGuild(Context.Guild.Id).Roles
                                 .SingleOrDefault(x => x.Name.ToString() == role);

                var roleList = guildUser.Roles.ToArray();
                if (roleList.Any(t => t.Name == role))
                {
                    await guildUser.RemoveRoleAsync(roleToGive);

                    await CommandHandeling.ReplyAsync(Context, "Буль!");

                    return;
                }

                await guildUser.AddRoleAsync(roleToGive);

                await CommandHandeling.ReplyAsync(Context, "Буль?");
            }
        }
Ejemplo n.º 9
0
        public async Task BanUser(IGuildUser user, string reason = null)
        {
            try
            {
                if (reason == null)
                {
                    await CommandHandeling.ReplyAsync(Context,
                        "Boole! You need to specify reason!");
                    return;
                }

                await user.Guild.AddBanAsync(user, 0, reason);
                var time = DateTime.Now.ToString("");
                var account = UserAccounts.GetAccount((SocketUser) user, Context.Guild.Id);
                account.Warnings += $"{time} {Context.User}: [ban]" + reason + "|";
                UserAccounts.SaveAccounts(Context.Guild.Id);
                var embed = new EmbedBuilder()
                    .WithColor(Color.DarkRed)
                    .AddField("💥 **ban** used", $"By {Context.User.Mention} in {Context.Channel}\n" +
                                                 $"**Content:**\n" +
                                                 $"{user.Mention} - {reason}")
                    .WithThumbnailUrl(Context.User.GetAvatarUrl())
                    .WithTimestamp(DateTimeOffset.UtcNow);
                var guild = ServerAccounts.GetServerAccount(Context.Guild);
                await Context.Guild.GetTextChannel(guild.LogChannelId).SendMessageAsync("", false, embed.Build());
            }
            catch
            {
             //   await ReplyAsync(
             //       "boo... An error just appear >_< \nTry to use this command properly: **ban [user_ping(or user ID)] [reason_mesasge]**\n" +
            //        "Alias: бан");
            }
        }
Ejemplo n.º 10
0
        public async Task JsonTask([Remainder] string mess)
        {
            try
            {
                var mylorikGlobal = Global.Client.GetUser(181514288278536193);
                var mylorik       = UserAccounts.GetAccount(mylorikGlobal, 0);

                var gameAndKey = mess.Split(new[] { "&&" }, StringSplitOptions.RemoveEmptyEntries);
                if (gameAndKey.Length < 2 || gameAndKey.Length >= 3)
                {
                    return;
                }

                mylorik.KeyPullName += gameAndKey[0] + "|";
                mylorik.KeyPullKey  += gameAndKey[1] + "|";
                UserAccounts.SaveAccounts(0);

                await CommandHandeling.ReplyAsync(Context, "Boooole~ We got the key!");


                ConsoleLogger.Log($" [ADD KEY] ({Context.User.Username}) - {mess}", ConsoleColor.DarkBlue);
            }
            catch
            {
                //  await ReplyAsync(
                //      "boooo... An error just appear >_< \nTry to use this command properly: **AddKey Gamename && key (platform)**\n");
            }
        }
Ejemplo n.º 11
0
        public async Task SetMyPrefix([Remainder] string prefix = null)
        {
            var account = UserAccounts.GetAccount(Context.User, Context.Guild.Id);

            if (prefix == null)
            {
                await CommandHandeling.ReplyAsync(Context,
                                                  $"Your prefix: **{account.MyPrefix}**");

                return;
            }

            if (prefix.Length < 100)
            {
                account.MyPrefix = prefix;
                if (prefix.Contains("everyone") || prefix.Contains("here"))
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      $"Boooooo! no `here` or `everyone` prefix!");

                    return;
                }

                UserAccounts.SaveAccounts(Context.Guild.Id);
                await CommandHandeling.ReplyAsync(Context,
                                                  $"Booole~, your own prefix is now **{prefix}**");
            }
            else
            {
                await CommandHandeling.ReplyAsync(Context,
                                                  "Booooo! Prefix have to be less than 100 characters");
            }
        }
Ejemplo n.º 12
0
        public async Task SetMyBirthday([Remainder] string stringdate)
        {
            if (!DateTime.TryParse(stringdate, out var myDate))
            {
                await CommandHandeling.ReplyAsync(Context, "Date input is not correct, you can try this `yyyy-mm-dd`");

                return;
            }
            var now = DateTime.UtcNow;

            myDate = DateTime.Parse(stringdate);
            if (now.Year - myDate.Year < 13)
            {
                await CommandHandeling.ReplyAsync(Context, "You must be over 13 years old to use Discord.");

                return;
            }
            var account = UserAccounts.GetAccount(Context.User, Context.Guild.Id);

            account.Birthday = myDate;

            UserAccounts.SaveAccounts(Context.Guild.Id);
            await CommandHandeling.ReplyAsync(Context, $"**Done!** You have born on {myDate.Year}-{myDate.Month}-{myDate.Day}\n\n" +
                                              $"Please say `MyCity city` to set TimeZone (default UTC)\n" +
                                              $"Btw, uyou may use **your language** to say the city");
        }
Ejemplo n.º 13
0
        public async Task Pick([Remainder] string message)
        {
            try
            {
                var option = message.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

                var rand      = new Random();
                var selection = option[rand.Next(0, option.Length)];

                var embed = new EmbedBuilder();
                embed.WithTitle("I chose instead " + Context.User.Username);
                embed.WithDescription(selection);

                embed.WithColor(new Color(255, 0, 94));
                embed.WithThumbnailUrl("https://i.imgur.com/I3o0bm4.jpg");


                await CommandHandeling.ReplyAsync(Context, embed);
            }
            catch
            {
                //   await ReplyAsync(
                //       "boo... An error just appear >_< \nTry to use this command properly: **pick option1|option2|option3**(output random option (can be as many as you want))\n");
            }
        }
Ejemplo n.º 14
0
        public async Task HelpFull()
        {
            var embed = new EmbedBuilder();


            embed.AddField("Extra Commands:",
                           "**roll number** random from 0 to number" +
                           "**roll number x** random from 0 to number **x** times\n" +
                           "**pick option1 | option2** Chooses for you. Example `pick go to sleep now| in an hour | do not go to sleep`\n" +
                           "**pass** You may buy next lvl Octo pass (say HelpPass more more info)\n" +
                           "**fact @user any_text** write down the fact about the user\n" +
                           "**fact @user** Will show a random fact about the user\n" +
                           "**guess amount**Roulette. The bot says how many slots you have to choose, choose one by writing the second message after the bot, example: `5`\n" +
                           "**AllOcto** still working on...\n" +
                           "**---------------------------------------------**\n" +
                           "_______ \n");
            embed.AddField("_____________", "**GiftPoints User number** transfer number of points to another user, 10% tax\n" +
                           "**OctoPoint User number**  Give Octo Points(admin)\n" +
                           "**OctoRep User number** Give Octo Reputation (admin)");


            embed.WithFooter("lil octo notebook");
            embed.WithColor(Color.LightOrange);
            await CommandHandeling.ReplyAsync(Context, embed);


            // embed.AddField("цитата [имя] [текст...] ", "Фейковая цитата от @юзера (*скриншот* с цветом, аватаркой, и текст)"); //font is NOT INCLUDET
            // command CARE
            // embed.AddField("капча [текст...]", "Фейковая капча\n" +
        }
Ejemplo n.º 15
0
        public async Task UpTime()
        {
            var proc = Process.GetCurrentProcess();

            var mem     = proc.WorkingSet64 / 1000000;
            var threads = proc.Threads;
            var time    = DateTime.Now - proc.StartTime;
            var cpu     = proc.TotalProcessorTime.TotalMilliseconds / proc.PrivilegedProcessorTime.TotalMilliseconds;


            var sw  = Stopwatch.StartNew();
            var msg = await Context.Channel.SendMessageAsync("check").ConfigureAwait(false);

            sw.Stop();

            await HelperFunctions.DeleteMessOverTime(msg, 0);

            var wtf = Global.CommandList;



            var embed = new EmbedBuilder();

            embed.WithColor(SecureRandomStatic.Random(254), SecureRandomStatic.Random(254), SecureRandomStatic.Random(254));
            embed.AddField("Bot Statistics:", $"Your ping: {(int) sw.Elapsed.TotalMilliseconds}ms\n" +
                           $"Runtime: {time.Hours}h:{time.Minutes}m\n" +
                           //$"CPU usage: {cpu:n0} (not right)\n" +
                           $"Memory: {mem:n0}Mb\n" +
                           $"Threads using: {threads.Count}\n" +
                           $"Commands in cache(100 max): {wtf.Count}\n" +
                           $"Servers in: {Global.Client.Guilds.Count}\n");
            await CommandHandeling.ReplyAsync(Context, embed);
        }
Ejemplo n.º 16
0
        public async Task HelpRemaind()
        {
            var embed = new EmbedBuilder();



            embed.AddField("Remind", "**Remind** any_text **in time** - create the reminder, example: `remind pull point in 20h`\n" +
                           "**RemindTo User_ID** any_text **in Time** -  Will remind the user. (user will see, WHO made this reminder.)\n" +
                           "**Re time_in_min any_text** - Abbreviated form. Example: `Re 180 Boole, I love boole!`\n" +
                           "**_____**\n" +
                           "**IN** is the key word. It has to be between the message and time\n" +
                           "_______\n");

            embed.AddField("Time", "Rule: **day > hour > min > sec**\n" +
                           "Any part may be dismissed, but others have to be in the order you see above\n" +
                           "You may say **1h30m** or with spaces **1d 3h 15m 30s** , **15m 44s**.\n" +
                           "Max values: `23h` `59m` `59s` (you may say 24h instead of 1d)\n" +
                           "**_______**\n");

            embed.AddField("Extra:",
                           "Bot will always give you feedback, good or bad.\n" +
                           "Bot will send you the DM with the reminder on time.\n" +
                           "Reminders will be saved even if bot crashed\n" +
                           "**_____**\n" +
                           "**List** - shows all your reminders\n" +
                           "**delete index** = will delete the reminder under the index\n" +
                           "**date** - date now by UTC\n" +
                           "**you may create reminder using direct DM to the bot**\n" +
                           "**_______**\n");
            embed.WithFooter("lil octo notebook");
            embed.WithColor(Color.LightOrange);

            await CommandHandeling.ReplyAsync(Context, embed);
        }
Ejemplo n.º 17
0
        public async Task MuteCommand(SocketGuildUser user, uint minute, [Remainder] string warningMess = null)
        {
            try
            {
                if (warningMess == null)
                {
                    await CommandHandeling.ReplyAsync(Context,
                        "Boole! You need to specify reason!");
                    return;
                }

                var check = Context.User as IGuildUser;
                var commandre = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                if (check != null && (commandre.OctoPass >= 100 || commandre.IsModerator > 0 ||
                                      check.GuildPermissions.MuteMembers))
                {
                    var hour = 0;
                    var timeFormat = $"{minute}m";

                    if (minute >= 60)
                        for (var i = 0; minute >= 59; i++)
                        {
                            minute = minute - 59;
                            hour++;

                            timeFormat = $"{hour}h {minute}m";
                        }

                    var timeString = timeFormat; //// MAde t ominutes

                    var timeDateTime = DateTime.UtcNow +
                                       TimeSpan.ParseExact(timeString, ReminderFormat.Formats,
                                           CultureInfo.CurrentCulture);

                    var roleToGive = Context.Guild.Roles
                        .SingleOrDefault(x => x.Name.ToString() == "Muted");


                    await user.ModifyAsync(u => { u.Mute = true; });
                    await user.AddRoleAsync(roleToGive);

                    var account = UserAccounts.GetAccount(user, 0);
                    account.MuteTimer = timeDateTime;
                    var time = DateTime.Now.ToString("");
                    account.Warnings += $"{time} {Context.User}: [mute]" + warningMess + "|";
                    UserAccounts.SaveAccounts(0);


                    await CommandHandeling.ReplyAsync(Context, $"{user.Mention} бу!");
                }
            }
            catch
            {
             //   await ReplyAsync(
            //        "boo... An error just appear >_< \nTry to use this command properly: **mute [user] [time_in_minutes] [Any_text]**\n");
            }
        }
Ejemplo n.º 18
0
        public async Task OctopusPictureSelector(int selection)
        {
            try
            {
                var passCheck = UserAccounts.GetAccount(Context.User, Context.Guild.Id);


                if (passCheck.OctoPass >= 1)
                {
                    var index = _secureRandom.Random(0, 254);
                    if (index == 68 || index == 228 || index == 18)
                    {
                        var lll = await Context.Channel.SendMessageAsync("boole");

                        HelperFunctions.DeleteMessOverTime(lll, 6);
                    }
                    else
                    {
                        if (OctoPicPull.OctoPics.Length - 1 < selection)
                        {
                            await Context.Channel.SendMessageAsync(
                                $"Boole. The maximum available index is {OctoPicPull.OctoPics.Length - 1}");

                            return;
                        }

                        var octoToPost = OctoPicPull.OctoPics[selection];

                        var color1Index = _secureRandom.Random(0, 254);
                        var color2Index = _secureRandom.Random(0, 254);
                        var color3Index = _secureRandom.Random(0, 254);

                        var randomIndex = _secureRandom.Random(0, OctoNamePull.OctoNameRu.Length);
                        var randomOcto  = OctoNamePull.OctoNameRu[randomIndex];

                        var embed = new EmbedBuilder();
                        embed.WithColor(color1Index, color2Index, color3Index);
                        embed.WithDescription($"{randomOcto} found:");
                        embed.WithFooter("lil octo notebook");
                        embed.WithAuthor(Context.User);
                        embed.WithImageUrl("" + octoToPost);


                        await CommandHandeling.ReplyAsync(Context, embed);
                    }
                }
                else
                {
                    await CommandHandeling.ReplyAsync(Context, "Boole! You do not have a tolerance of this level!");
                }
            }
            catch
            {
                // await ReplyAsync(
                //       "boo... An error just appear >_< \nTry to use this command properly: **Octo [Octo_index]**\n");
            }
        }
Ejemplo n.º 19
0
        public async Task Sub(SocketUser user)
        {
            try
            {
                if (user.Id == 423593006436712458)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      "Нельзя подписываться на осьминожку!");


                    return;
                }

                if (user.IsBot)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      "Нельзя подписываться на бота.");


                    return;
                }

                var account = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                var el      = UserAccounts.GetAccount(user, Context.Guild.Id);


                if (account.SubToPeople != null)
                {
                    var accountSubs = account.SubToPeople.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

                    if (accountSubs.Any(t => t == user.Id.ToString()))
                    {
                        await CommandHandeling.ReplyAsync(Context,
                                                          $"Ты уже подписан на {user.Username}.");


                        return;
                    }
                }


                account.SubToPeople += user.Id + "|";
                el.SubedToYou       += Context.User.Id + "|";
                UserAccounts.SaveAccounts(Context.Guild.Id);


                await CommandHandeling.ReplyAsync(Context,
                                                  $"Ты подписался на {user.Username}!\nЕсли хочешь отписаться введи команду ***unsub [user]**");
            }
            catch
            {
                //    await ReplyAsync(
                //        "boo... An error just appear >_< \nTry to use this command properly: **Sub [user_ping (or user ID)**(follow someone's blog)\n" +
                //        "Alias: follow");
            }
        }
Ejemplo n.º 20
0
        public async Task SetServerActivivtyLogOff()
        {
            var guild = ServerAccounts.GetServerAccount(Context.Guild);

            guild.LogChannelId      = 0;
            guild.ServerActivityLog = 0;
            ServerAccounts.SaveServerAccounts();

            await CommandHandeling.ReplyAsync(Context, $"Boole.");
        }
Ejemplo n.º 21
0
        public async Task Commandment()
        {
            var embed = new EmbedBuilder();

            embed.WithImageUrl(
                "https://media.discordapp.net/attachments/238416197337481217/436790640861511691/--2oOzEe8RI.png");
            embed.WithTitle("10 заповедей бога лола");

            await CommandHandeling.ReplyAsync(Context, embed);
        }
Ejemplo n.º 22
0
        public async Task BuildExistingServer()
        {
            var guild = Global.Client.Guilds.ToList();

            foreach (var t in guild)
            {
                ServerAccounts.GetServerAccount(t);
            }

            await CommandHandeling.ReplyAsync(Context, "Севера бобавлены, бууууль!");
        }
Ejemplo n.º 23
0
        public async Task TopByRoles(int page = 1)
        {
            try
            {
                if (page < 1)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      "Boole! Try different page <_<");

                    return;
                }

                var rolesList = Context.Guild.Roles.ToList();

                const int usersPerPage = 8;

                var lastPage = 1 + rolesList.Count / (usersPerPage + 1);
                if (page > lastPage)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      $"Boole. Last Page is {lastPage}");

                    return;
                }

                var orderedRolesList = rolesList.OrderByDescending(acc => acc.Members.Count()).ToList();

                var embB = new EmbedBuilder()
                           .WithTitle("Top By Roles:")
                           .WithFooter(
                    $"Page {page}/{lastPage} ● Say \"topRoles 2\" to see second page (you can edit previous message)");
                page--;

                for (var i = 1; i <= usersPerPage && i + usersPerPage * page <= orderedRolesList.Count; i++)
                {
                    var num = i + usersPerPage * page - 1;
                    embB.AddField($"#{i + usersPerPage * page} {orderedRolesList[num].Name}",
                                  $"**Members:** {orderedRolesList[num].Members.Count()}\n" +
                                  $"**Color:** {orderedRolesList[num].Color}\n" +
                                  $"**Created:** {orderedRolesList[num].CreatedAt.DateTime}\n" +
                                  $"**Is Mentionable:** {orderedRolesList[num].IsMentionable}\n" +
                                  $"**Position:** {orderedRolesList[num].Position}\n" +
                                  $"**ID:** {orderedRolesList[num].Id}\n\n**_____**", true);
                }

                await CommandHandeling.ReplyAsync(Context, embB);
            }
            catch
            {
                //   await ReplyAsync(
                //       "boo... An error just appear >_< \nTry to use this command properly: **top [page_number]**(Top By Activity)\nAlias: topl");
            }
        }
Ejemplo n.º 24
0
        public async Task GivePullPoints(SocketGuildUser user, int pullPoints)
        {
            var account = UserAccounts.GetAccount(user, 0);

            account.DailyPullPoints += pullPoints;
            UserAccounts.SaveAccounts(0);
            var embed = new EmbedBuilder();

            embed.WithColor(Color.DarkMagenta);
            embed.AddField("буууль~",
                           $"Мы добавили {pullPoints} пулл Поинтов {user.Mention}. Теперь у него {account.DailyPullPoints} поинтов, буль!");
            await CommandHandeling.ReplyAsync(Context, embed);
        }
Ejemplo n.º 25
0
        // [RequireUserPermission(GuildPermission.Administrator)]
        public async Task WarnUser(IGuildUser user, [Remainder] string message = null)
        {
            try
            {
                if (message == null)
                {
                    await CommandHandeling.ReplyAsync(Context,
                        "Boole! You need to specify reason!");
                    return;
                }

                var check = Context.User as IGuildUser;
                var comander = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                if (check != null && (comander.OctoPass >= 100 || comander.IsModerator >= 1 ||
                                      check.GuildPermissions.ManageRoles ||
                                      check.GuildPermissions.ManageMessages))
                {
                    var time = DateTime.Now.ToString("");
                    var account = UserAccounts.GetAccount((SocketUser) user, Context.Guild.Id);
                    account.Warnings += $"{time} {Context.User}: [warn]" + message + "|";
                    UserAccounts.SaveAccounts(Context.Guild.Id);


                    await CommandHandeling.ReplyAsync(Context,
                        user.Mention + " Was Forewarned");


                    var embed = new EmbedBuilder()
                        .WithColor(Color.DarkRed)
                        .AddField("📉 **WARN** used", $"By {Context.User.Mention} in {Context.Channel}\n" +
                                                      $"**Content:**\n" +
                                                      $"{user.Mention} - {message}")
                        .WithThumbnailUrl(Context.User.GetAvatarUrl())
                        .WithTimestamp(DateTimeOffset.UtcNow);

                    var guild = ServerAccounts.GetServerAccount(Context.Guild);
                    await Context.Guild.GetTextChannel(guild.LogChannelId).SendMessageAsync("", false, embed.Build());
                }
                else
                {
                    await CommandHandeling.ReplyAsync(Context,
                        "Boole! You do not have a tolerance of this level!");
                }
            }
            catch
            {
             //   await ReplyAsync(
            //        "boo... An error just appear >_< \nTry to use this command properly: **warn [user_ping(or user ID)] [reason_mesasge]**\n" +
            //        "Alias: варн, warning, предупреждение");
            }
        }
Ejemplo n.º 26
0
        public async Task ColorApd()
        {
            try
            {
                /*
                 * var peaceKeepo = Emote.Parse("<:PeaceKeepo:438257037667729408>");
                 * var praise = Emote.Parse("<:praise:445274481917952001>");
                 * var rem = Emote.Parse("<:rem:445275743719522304>");
                 * var steampunk = Emote.Parse("<:Steampunk:445276776676196353>");
                 * var mumu = Emote.Parse("<:mumu:445277916872310785>");
                 * var monkaS = Emote.Parse("<:monkaS:398183436613058570>");
                 */

                var embed = new EmbedBuilder();
                embed.WithAuthor(Global.Client.GetUser(326736083847086081));
                embed.WithFooter("lil octo notebook");
                embed.WithColor(Color.Green);
                embed.AddField("Роль для цвета",
                               $"Чтобы **получить** или **снять** роль нажмите определенную эмоцию, или пропишите соответствующую команду в <#374914059679694848>\n" +
                               $"**_______**\n");
                embed.AddField("Тыки на эмоцию",
                               $"{new Emoji("<:rem:445275743719522304>")} <@&374900834946908160> - последователи анимэ (!weeb)\n{new Emoji("🦊")} <@&375079829642412034>- могущественные лисы и лисицы! (!fox)\n" +
                               $"{new Emoji("<:PeaceKeepo:438257037667729408>")} <@&374900824880447489> - Авэ Мария! (!deus)\n" +
                               $"{new Emoji("<:Steampunk:445276776676196353>")} <@&374900827632041986> - нет того, чего нельзя изобрести на паровом движке (!steampunk)\n" +
                               $"{new Emoji("<:praise:445274481917952001>")} <@&440420047005941761> - Praise The Sun (!praise)\n{new Emoji("<:monkaS:398183436613058570>")} <@&374900838096961546> - последователи великого Пепе (!meme)\n" +
                               $"{new Emoji("🐲")} <@&374900821382529025> - лазурные драконы! (!dragon)\n{new Emoji("🐼")} <@&374980985281970206> - злобные  существа - Панды  (!panda)\n" +
                               $"{new Emoji("🦎")} <@&425736884870840322> - ящеры хвостатые (!lizard)\n{new Emoji("🌑")} <@&375197931793285130> - тени сервера (!shadow)\n" +
                               $"{new Emoji("<:mumu:445277916872310785>")} <@&374981082707394569> - добрые, в отличие от Панд, Мыфы (!nazrin)\n{new Emoji("🐱")} <@&375376861594910720> - кисики сервера (!cat)\n");

                if (await Global.Client.GetGuild(338355570669256705)
                    .GetTextChannel(374627268162617344)
                    .GetMessageAsync(445501974608216064) is IUserMessage message)
                {
                    await message.ModifyAsync(mess =>
                    {
                        mess.Embed = embed.Build();
                        // This somehow can't be empty or it won't update the
                        // embed propperly sometimes... I don't know why
                        // message.Content =  Constants.InvisibleString;
                    });
                }


                await CommandHandeling.ReplyAsync(Context,
                                                  "Бульк. Мы заапдейтили сообщение для цветов!");
            }
            catch (Exception e)
            {
                Console.WriteLine("ERROR: '{0}'", e);
            }
        }
Ejemplo n.º 27
0
        public async Task AllKeys()
        {
            try
            {
                var account = UserAccounts.GetAccount(Context.User, 0);

                var keyName    = account.KeyPullName.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                var keyKey     = account.KeyPullKey.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                var keys       = "";
                var keysExtra  = "";
                var keysExtra2 = "";

                for (var i = 0; i < keyName.Length; i++)
                {
                    if (keys.Length <= 800)
                    {
                        keys += $"index: {i} | {keyName[i]} {keyKey[i]}\n";
                    }
                    else if (keys.Length <= 1600)
                    {
                        keysExtra += $"index: {i} | {keyName[i]} {keyKey[i]} \n";
                    }
                    else
                    {
                        keysExtra2 += $"index: {i} | {keyName[i]} {keyKey[i]} \n";
                    }
                }

                var embed = new EmbedBuilder();
                embed.WithAuthor(Context.User);
                embed.AddField("Ключи:", $"{keys}\n**KeyDel [index]** Чтобы удалить ");
                embed.WithFooter("lil octo notebook");
                if (keysExtra.Length > 10)
                {
                    embed.AddField("Ключи(cont):", $"{keysExtra}\n**KeyDel [index]** Чтобы удалить ");
                }
                if (keysExtra2.Length > 10)
                {
                    embed.AddField("Ключи(cont):", $"{keysExtra2}\n**KeyDel [index]** Чтобы удалить ");
                }


                await CommandHandeling.ReplyAsync(Context, embed);
            }
            catch
            {
                //   await ReplyAsync(
                //       "boo... An error just appear >_< \nTry to use this command properly: **Keys** (show all **YOUR** keys)\n");
            }
        }
Ejemplo n.º 28
0
        public async Task AvailableAllKeys()
        {
            try
            {
                var mylorikGlobal = Global.Client.GetUser(181514288278536193);
                var account       = UserAccounts.GetAccount(mylorikGlobal, 0);

                var keyName    = account.KeyPullName.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                var keys       = "";
                var keysExtra  = "";
                var keysExtra2 = "";

                for (var i = 0; i < keyName.Length; i++)
                {
                    if (keys.Length <= 800)
                    {
                        keys += $"{i + 1}) {keyName[i]}\n";
                    }
                    else if (keys.Length <= 1600)
                    {
                        keysExtra += $"{i + 1}) {keyName[i]}\n";
                    }
                    else
                    {
                        keysExtra2 += $"{i + 1}) {keyName[i]}\n";
                    }
                }

                var embed = new EmbedBuilder();
                embed.WithAuthor(Context.User);
                embed.AddField("Keys:", $"{keys}\n");
                embed.WithFooter("lil octo notebook");
                if (keysExtra.Length > 10)
                {
                    embed.AddField("Keys(cont):", $"{keysExtra}\n");
                }
                if (keysExtra2.Length > 10)
                {
                    embed.AddField("Keys(cont):", $"{keysExtra2} ");
                }


                await CommandHandeling.ReplyAsync(Context, embed);
            }
            catch
            {
                //   await ReplyAsync(
                //       "boo... An error just appear >_< \nTry to use this command properly: **Keys** (show all **YOUR** keys)\n");
            }
        }
Ejemplo n.º 29
0
        public async Task LeaveGuild(int page = 1)
        {
            if (page < 1)
            {
                await CommandHandeling.ReplyAsync(Context,
                                                  "Boole! Try different page <_<");

                return;
            }

            var       accounts     = Global.Client.Guilds.ToList().OrderByDescending(x => x.MemberCount).ToList();
            const int usersPerPage = 9;

            var lastPage = 1 + accounts.Count / (usersPerPage + 1);

            if (page > lastPage)
            {
                await CommandHandeling.ReplyAsync(Context,
                                                  $"Boole. Last Page is {lastPage}");

                return;
            }

            var ordered = accounts;

            var embB = new EmbedBuilder()
                       .WithTitle("Top By Guilds:")
                       .WithFooter(
                $"Page {page}/{lastPage} ● Say \"topGuild 2\" to see second page (you can edit previous message)");


            page--;
            for (var j = 0; j < ordered.Count; j++)
            {
                if (ordered[j].Id == Context.Guild.Id)
                {
                    embB.WithDescription(
                        $"**#{j + usersPerPage * page + 1} {Context.Guild.Name} ({Context.Guild.Id}) {ordered[j].MemberCount} Members**\n**______**");
                }
            }

            for (var i = 1; i <= usersPerPage && i + usersPerPage * page <= ordered.Count; i++)
            {
                var account = ordered[i - 1 + usersPerPage * page];
                //var guildAccount =
                embB.AddField($"#{i + usersPerPage * page} {account.Name} ({account.Id})", $"{account.MemberCount} Members", true);
            }

            await CommandHandeling.ReplyAsync(Context, embB);
        }
Ejemplo n.º 30
0
        public async Task ShowUserReminders(SocketUser user)
        {
            try
            {
                var commander = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                if (commander.OctoPass >= 10)
                {
                    var account = UserAccounts.GetAccount(user, 0);
                    if (account.ReminderList.Count == 0)
                    {
                        var bigmess =
                            "Booole... You have no reminders! You can create one by using the command `Remind [text] in [time]`\n" +
                            "(Time can be different, but follow the rules! **day-hour-minute-second**. You can skip any of those parts, but they have to be in the same order. One space or without it between each of the parts\n" +
                            "I'm a loving order octopus!";

                        await CommandHandeling.ReplyAsync(Context, bigmess);

                        return;
                    }

                    var reminders = account.ReminderList;
                    var embed     = new EmbedBuilder();
                    embed.WithTitle("Your Reminders:");
                    embed.WithDescription($"**Your current time by UTC: {DateTime.UtcNow}**\n" +
                                          "To delete one of them, type the command `*del [index]`");
                    embed.WithFooter("lil octo notebook");

                    for (var i = 0; i < reminders.Count; i++)
                    {
                        embed.AddField($"[{i + 1}] {reminders[i].DateToPost:f}", reminders[i].ReminderMessage, true);
                    }


                    await CommandHandeling.ReplyAsync(Context, embed);
                }
                else
                {
                    await Context.Channel.SendMessageAsync("Boole! You do not have a tolerance of this level!");
                }
            }
            catch
            {
                var botMess = await ReplyAsync(
                    "boo... An error just appear >_< \n" +
                    "Say `HelpRemind`");

                HelperFunctions.DeleteMessOverTime(botMess, 5);
            }
        }