Example #1
0
        private async Task HandleCommandAsync(SocketMessage s)
        {
            var msg = s as SocketUserMessage;

            if (msg == null)
            {
                return;
            }
            var context = new SocketCommandContext(_client, msg);

            //check for user is muted
            var userAccount = UserAccounts.GetAccount(context.User);

            if (userAccount.isMuted)
            {
                await context.Message.DeleteAsync();

                return;
            }

            //Award XP for messages
            if (!context.User.IsBot)
            {
                Leveling.OnUserSentMessage((SocketGuildUser)context.User, (SocketTextChannel)context.Channel);
            }

            int argPos = 0;

            if (msg.HasStringPrefix(Config.bot.cmdPrefix, ref argPos) ||
                msg.HasMentionPrefix(_client.CurrentUser, ref argPos))
            {
                var result = await _service.ExecuteAsync(context, argPos, services : null);

                if (!result.IsSuccess && result.Error != CommandError.UnknownCommand)
                {
                    Console.WriteLine(result.ErrorReason);
                }
            }
        }
Example #2
0
        public async Task Status([Remainder] SocketUser user = null)
        {
            user ??= Context.User;
            var account = UserAccounts.GetAccount(user);
            var factory = new PlayerFighterFactory();
            var p       = factory.CreatePlayerFighter(user);

            var author = new EmbedAuthorBuilder();

            author.WithName($"{(user is SocketGuildUser sguser ? sguser.DisplayName() : user.Username)}");
            author.WithIconUrl(user.GetAvatarUrl());


            var embed = new EmbedBuilder()
                        .WithColor(Colors.Get(account.Element.ToString()))
                        .WithAuthor(author)
                        .WithTitle($"Level {account.LevelNumber} {account.GsClass} {string.Join("", account.TrophyCase.Trophies.Select(t => t.Icon))} (Rank {UserAccounts.GetRank(user) + 1})")
                        .AddField("Current Equip", account.Inv.GearToString(AdeptClassSeriesManager.GetClassSeries(account).Archtype), true)
                        .AddField("Psynergy", p.GetMoves(false), true)
                        .AddField("Djinn", account.DjinnPocket.GetDjinns().GetDisplay(DjinnDetail.None), true)

                        .AddField("Stats", p.Stats.ToString(), true)
                        .AddField("Elemental Stats", p.ElStats.ToString(), true)

                        .AddField("Unlocked Classes", account.BonusClasses.Count == 0 ? "none" : string.Join(", ", account.BonusClasses))

                        .AddField("XP", $"{account.XP} - next in {account.XPneeded}{(account.NewGames > 1 ? $"\n({account.TotalXP} total | {account.NewGames} resets)" : "")}", true)
                        .AddField("Colosso wins | Endless Streaks", $"{account.ServerStats.ColossoWins}", true)
                        .AddField("Endless Streaks", $"Solo: {account.ServerStats.EndlessStreak.Solo} | Duo: {account.ServerStats.EndlessStreak.Duo} \nTrio: {account.ServerStats.EndlessStreak.Trio} | Quad: {account.ServerStats.EndlessStreak.Quad}", true);

            if (user is SocketGuildUser socketGuildUser)
            {
                var Footer = new EmbedFooterBuilder();
                Footer.WithText("Joined this Server on " + socketGuildUser.JoinedAt.Value.Date.ToString("dd-MM-yyyy"));
                Footer.WithIconUrl(Sprites.GetImageFromName("Iodem"));
                embed.WithFooter(Footer);
            }
            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Example #3
0
        internal static async void MessageCounter(SocketGuildUser user, SocketTextChannel channel, SocketUserMessage message)
        {
            Random rngXp       = new Random();
            var    userAccount = UserAccounts.GetAccount(user);

            uint oldLevel = userAccount.Level;
            uint xpGain   = (uint)rngXp.Next(0, 101);

            userAccount.XP += xpGain;
            UserAccounts.SaveAccounts();

            uint newLevel = userAccount.Level;

            if (oldLevel != newLevel)
            {
                if (channel.Id == 513494298801733637)
                {
                    await channel.SendMessageAsync(user.Mention + " just leveled up to level " + newLevel + "!");
                }
            }
            Console.WriteLine(user.Username + " -> (" + xpGain + "xp) :" + message + " <" + channel.Name + ">");
        }
Example #4
0
        public async Task MyStats(IGuildUser user)
        {
            var account = UserAccounts.GetAccount((SocketUser)user);

            if (null == account)
            {
                return;
            }

            uint CurrentLevel = account.LevelNumber;
            uint CurrentXP    = account.XP;
            uint NextLevelXP  = (uint)Math.Pow(CurrentLevel + 1, 2) * 50;
            uint ExpTNL       = (uint)Math.Abs(NextLevelXP - CurrentXP);

            var embed = new EmbedBuilder();

            embed.WithTitle("Level : " + CurrentLevel);
            embed.WithDescription($"**Has {CurrentXP} XP\n\n>> Next level at {NextLevelXP}**\n\n");
            embed.WithColor(new Color(0, 255, 0));
            embed.WithTimestamp(DateTimeOffset.FromUnixTimeMilliseconds(1534271035765));
            await Context.Channel.SendMessageAsync("", false, embed);
        }
        public async Task AddPoints(SocketGuildUser user, int amount)
        {
            UserAccounts.GetAccount(user).Points += amount;
            UserAccounts.SaveAccounts();
            var eb = new EmbedBuilder()
            {
                Author = new EmbedAuthorBuilder()
                {
                    IconUrl = $"{user.GetAvatarUrl()}",
                    Name    = $"Added points to user",
                },
                Color  = Color.DarkBlue,
                Footer = new EmbedFooterBuilder()
                {
                    Text = $"{DateTime.Now}",
                },
                Description = $"{amount} Points added to user: {user.Mention}",
            };

            DiscordReply("", eb);
            await Task.CompletedTask;
        }
Example #6
0
        public async Task Element(Element chosenElement)
        {
            var embed   = new EmbedBuilder();
            var account = UserAccounts.GetAccount(Context.User);

            var role        = Context.Guild.Roles.FirstOrDefault(x => x.Name == chosenElement.ToString() + " Adepts");
            var venusRole   = Context.Guild.Roles.FirstOrDefault(x => x.Name == "Venus Adepts");
            var marsRole    = Context.Guild.Roles.FirstOrDefault(x => x.Name == "Mars Adepts");
            var jupiterRole = Context.Guild.Roles.FirstOrDefault(x => x.Name == "Jupiter Adepts");
            var mercuryRole = Context.Guild.Roles.FirstOrDefault(x => x.Name == "Mercury Adepts");
            var exathi      = Context.Guild.Roles.FirstOrDefault(x => x.Name == "Exathi") ?? venusRole;

            if (role == null)
            {
                return;
            }

            if (chosenElement == account.Element)
            {
                return;
            }

            await(Context.User as IGuildUser).RemoveRolesAsync(new IRole[] { venusRole, marsRole, jupiterRole, mercuryRole, exathi });
            await(Context.User as IGuildUser).AddRoleAsync(role);

            foreach (string removed in account.Inv.UnequipExclusiveTo(account.Element))
            {
                var removedEmbed = new EmbedBuilder();
                removedEmbed.WithDescription($"<:Exclamatory:571309036473942026> Your {removed} was unequipped.");
                await Context.Channel.SendMessageAsync("", false, removedEmbed.Build());
            }

            account.Element     = chosenElement;
            account.ClassToggle = 0;
            UserAccounts.SaveAccounts();
            embed.WithColor(Colors.Get(chosenElement.ToString()));
            embed.WithDescription($"Welcome to the {chosenElement.ToString()} Clan, {account.GsClass} {((SocketGuildUser)Context.User).DisplayName()}!");
            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Example #7
0
        public async Task Claim()
        {
            var account = UserAccounts.GetAccount(Context.User);
            var inv     = account.Inv;

            if (DateTime.Now <= new DateTime(2019, 7, 1) && account.LastClaimed < new DateTime(2019, 6, 1))
            {
                var coins = account.LevelNumber * 120;
                inv.AddBalance(coins);
                var chest1 = (ChestQuality)Math.Max(0, Math.Min(4, ((int)account.LevelNumber / 11) - 1));
                var chest2 = (ChestQuality)Math.Max(0, Math.Min(4, ((int)account.LevelNumber / 11 - 2)));
                inv.AwardChest(chest1);
                inv.AwardChest(chest2);

                var embed = new EmbedBuilder();
                embed.WithColor(Colors.Get("Iodem"));
                embed.WithDescription($"Thank you for being part of this server! I hope you have fun with the new items. Here, take this: \n <:coin:569836987767324672>{coins}\n Also, take these to start off your journey: \n{Inventory.ChestIcons[chest2]} {Inventory.ChestIcons[chest1]} ");
                embed.WithThumbnailUrl(Sprites.GetImageFromName("Iodem"));
                account.LastClaimed = DateTime.Now;
                await Context.Channel.SendMessageAsync("", false, embed.Build());
            }
        }
Example #8
0
        public static async Task GiveCoins(SocketCommandContext context, SocketGuildUser sender, SocketGuildUser reciever, int amount)
        {
            var SenderAccount   = UserAccounts.GetAccount(sender);
            var RecieverAccount = UserAccounts.GetAccount(reciever);

            if (amount < 1)
            {
                await PrintEmbed(context.Channel, $"You must enter an amount greater than 1, {sender.Mention}.");

                return;
            }
            else if (amount > SenderAccount.coins)
            {
                await PrintEmbed(context.Channel, $"You do not have that many coins to send, {sender.Mention}.");

                return;
            }
            SenderAccount.coins   -= amount;
            RecieverAccount.coins += amount;
            UserAccounts.SaveAccounts();
            await PrintEmbedNoFooter(context.Channel, $"{sender.Mention} gave {reciever.Mention} {amount} coins.");
        }
Example #9
0
        public async Task Unblacklist(SocketUser id)
        {
            stopWatch.Start();
            var userAccount = UserAccounts.GetAccount(id);

            userAccount.Blacklisted = 0;
            UserAccounts.SaveAccounts();

            embed.WithTitle("User Unblacklisted");
            if (userAccount.Username != null)
            {
                embed.WithDescription($"User `{userAccount.Username}` with ID `{userAccount.ID}` has been Unblacklisted from Kaguya functionality.");
            }
            else if (userAccount.Username == null || userAccount.Username == "")
            {
                embed.WithDescription($"ID `{userAccount.ID}` has been Unblacklisted from Kaguya functionality.");
            }
            embed.WithFooter("Please note that all Points and EXP are not able to be restored.");
            embed.WithColor(Pink);
            await BE(); stopWatch.Stop();
            logger.ConsoleCommandLog(Context, stopWatch.ElapsedMilliseconds, "User Unblacklisted");
        }
Example #10
0
        public async Task DeleteReminder(int index)
        {
            try
            {
                var account = UserAccounts.GetAccount(Context.User, 0);

                var reminders = account.ReminderList;

                if (index > 0 && index <= reminders.Count)
                {
                    reminders.RemoveAt(index - 1);
                    UserAccounts.SaveAccounts(0);
                    var embed = new EmbedBuilder();
                    // embed.WithImageUrl("");
                    embed.WithTitle("Boole.");
                    embed.WithDescription($"Message by index **{index}** was removed!");
                    embed.WithFooter("lil octo notebook");


                    await CommandHandeling.ReplyAsync(Context, embed);

                    return;
                }

                var bigmess =
                    $"Booole...We could not find this reminder, could there be an error?\n" +
                    $"Try to see all of your reminders through the command `list`";

                await CommandHandeling.ReplyAsync(Context, bigmess);
            }
            catch
            {
                var botMess = await ReplyAsync(
                    "boo... An error just appear >_< \n" +
                    "Say `HelpRemind`");

                HelperFunctions.DeleteMessOverTime(botMess, 5);
            }
        }
Example #11
0
        public async Task WarnUser(IGuildUser user)
        {
            var userAccount = UserAccounts.GetAccount((SocketUser)user);

            userAccount.NumberOfWarnings++;
            UserAccounts.SaveAccounts();

            if (userAccount.NumberOfWarnings >= 3)
            {
                await Context.Channel.SendMessageAsync(user + " has been banned!");

                await user.Guild.AddBanAsync(user, 7);
            }
            else if (userAccount.NumberOfWarnings == 1)
            {
                await Context.Channel.SendMessageAsync("You currently have 1 warning!");
            }
            else if (userAccount.NumberOfWarnings == 2)
            {
                await Context.Channel.SendMessageAsync("You currently have 2 warnings!");
            }
        }
Example #12
0
        public async Task RockPaperScissorsAsync([Remainder] RpsEnum choice)
        {
            string[] emotesPlayer = { "🤜", "🖐️", "✌️" };
            string[] emotesCPU    = { "🤛", "🖐️", "✌️" };

            var     avatar    = UserAccounts.GetAccount(Context.User);
            RpsEnum cpuChoice = (RpsEnum)((new Random()).Next(0, 1000) % 3);
            string  result    = "";

            switch ((int)choice - (int)cpuChoice)
            {
            case 1:
            case -2:
                result = "You read me like an open book! You win!";
                await ServerGames.UserWonRPS((SocketGuildUser)Context.User, (SocketTextChannel)Context.Channel);

                break;

            case 0:
                ServerGames.UserDidNotWinRPS((SocketGuildUser)Context.User);
                result = "I may not have the gift of Psynergy, but I can still match your strength!";
                break;

            case -1:
            case 2:
                ServerGames.UserDidNotWinRPS((SocketGuildUser)Context.User);
                result = "Ahah! I may forever remember the day I beat an Adept in a fair game!";
                break;
            }

            var embed = new EmbedBuilder();

            embed.WithColor(Colors.Get("Iodem"));
            embed.WithDescription($"{emotesPlayer[(int)choice]} vs {emotesCPU[(int)cpuChoice]}");
            embed.AddField("Result:", result);

            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Example #13
0
        public async Task Daily(SocketUser socketUser = null)
        {
            if (socketUser == null)
            {
                socketUser = Context.User;
                UserAccount account = UserAccounts.GetAccount(socketUser);
                if (DateTime.UtcNow - account.DailyDateTime > TimeSpan.FromDays(1))
                {
                    account.Xp           += 200;
                    account.DailyDateTime = DateTime.UtcNow;
                    await Context.Channel.SendMessageAsync($"Hey {socketUser.Mention}, You gained 200 XP.");

                    UserAccounts.SaveAccounts();
                }
                else
                {
                    await Context.Channel.SendMessageAsync($"There there you needy child. " +
                                                           $"{(24 - (DateTime.UtcNow - account.DailyDateTime).TotalHours).ToString("N2")} Hours to go.");
                }
            }
            else
            {
                string targetRole = ((SocketGuildUser)socketUser).Guild.Roles.ToList().FirstOrDefault()?.ToString();
                if (PermissionHelper.IsUserRoleHolder((SocketGuildUser)Context.User, targetRole))
                {
                    UserAccount account = UserAccounts.GetAccount(socketUser);
                    account.Xp += 200;
                    await Context.Channel.SendMessageAsync($"Hey {socketUser.Mention}, You gained 200 XP.");

                    UserAccounts.SaveAccounts();
                }
                else
                {
                    await Context.Channel.SendMessageAsync(
                        $"Mmm sorry {Context.User.Mention}, You need to be a {targetRole} to be able to do so");
                }
            }
        }
Example #14
0
        public async Task Repped(SocketUser socketUser)
        {
            if (socketUser == Context.User)
            {
                await ReplyAsync("Dude thats like looking in the mirror and jerkin off. FFS."); //Thanks L

                return;
            }

            UserAccount account = UserAccounts.GetAccount(Context.User);

            if (account.RepperList.Contains(socketUser.Id))
            {
                await ReplyAsync("Hey Hey Hey you already did it once.");

                IEnumerable <SocketGuildUser> allTheRepped =
                    from a in Context.Guild.Users where account.RepperList.Contains(a.Id) select a;
                var embed = new EmbedBuilder();
                embed.WithTitle("You have repped all these lads so far");
                embed.WithThumbnailUrl(
                    "https://media1.tenor.com/images/b6dff5dd473c0b1b5f6ade724c9434ed/tenor.gif?itemid=4068088");
                embed.WithCurrentTimestamp();
                var temp = 1;
                foreach (SocketGuildUser a in allTheRepped)
                {
                    embed.Description += $"\n{temp++.ToString()}. {a.Username}";
                }
                await ReplyAsync("", false, embed.Build());
            }
            else
            {
                account.RepperList.Add(socketUser.Id);
                account.Countem++;
                await ReplyAsync("Okay you +repped " + socketUser.Username);
            }

            UserAccounts.SaveAccounts();
        }
Example #15
0
        public async Task Daily()
        {
            if (!CheckEconomyEnabled(Context).Result)
            {
                return;
            }

            var userAccount = UserAccounts.GetAccount(Context.User);

            if (Math.Abs(DateTime.Today.Day - userAccount.PreviousDailyTime.Day) < 1)
            {
                await Context.Channel.SendMessageAsync(
                    $"Please wait {Math.Abs(24 - DateTime.Now.Hour)} more hours!");

                return;
            }

            if (Math.Abs(DateTime.Now.Day - userAccount.PreviousDailyTime.Day) > 1)
            {
                userAccount.PreviousDailyAmount = 500;
                userAccount.DailyStreak         = 0;
            }

            if (userAccount.PreviousDailyAmount == 0)
            {
                userAccount.PreviousDailyAmount = 500;
            }

            uint amt = userAccount.PreviousDailyAmount += userAccount.PreviousDailyAmount / 35;

            userAccount.Yen += amt;
            userAccount.DailyStreak++;

            await Context.Channel.SendMessageAsync($"You received ¥{amt} for the day!\n" +
                                                   $"**Streak:** {userAccount.DailyStreak}");

            userAccount.PreviousDailyTime = DateTime.Now;
        }
Example #16
0
        public async Task DeleteTheFucktUser(int index)
        {
            try
            {
                var account = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                if (account.OctoPass >= 2)
                {
                    var fuckts = account.Fuckt.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    account.Fuckt = null;

                    for (var i = 0; i < fuckts.Length; i++)
                    {
                        if (i != index)
                        {
                            account.Fuckt += $"{fuckts[i]}|";
                        }
                    }

                    UserAccounts.SaveAccounts(Context.Guild.Id);


                    await CommandHandeling.ReplyAsync(Context,
                                                      $"fact under index {index} was removed from the lil octo notebook ;c");
                }
                else

                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      "Boole :< You do not have 3rd level tolerance");
                }
            }
            catch
            {
                //    await ReplyAsync(
                //        "boo... An error just appear >_< \nTry to use this command properly: **del [index]**(delete [index] fact)\n" +
                //        "Alias: УдалитьФакт");
            }
        }
Example #17
0
        public async Task CheckMySubscriptions()
        {
            try
            {
                var account = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                if (account.SubToPeople == null)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      $"Ты и так ни на кого не подписан, буль!");


                    return;
                }

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


                var mess = "";
                for (var i = 0; i < accountSubs.Length; i++)
                {
                    var globalAccount = Client.GetUser(Convert.ToUInt64(accountSubs[i]));
                    mess += $"{i + 1}. {globalAccount.Username}\n";
                }

                var embed = new EmbedBuilder();
                embed.WithFooter("lil octo notebook");
                embed.WithTitle("Твои подписки:");
                embed.WithDescription($"{mess}");

                await CommandHandeling.ReplyAsync(Context, embed);
            }
            catch
            {
                //     await ReplyAsync(
                //         "boo... An error just appear >_< \nTry to use this command properly: **subs**(showing all people you follow)\n" +
                //         "Alias: MySubs, Subscriptions, подписки");
            }
        }
Example #18
0
        [Command("osuset")] //osu
        public async Task osuSet([Remainder] string username)
        {
            stopWatch.Start();
            var    userAccount = UserAccounts.GetAccount(Context.User);
            string oldUsername = userAccount.OsuUsername;

            if (oldUsername == null)
            {
                oldUsername = "******";
            }
            username = username.Replace(" ", "_");
            userAccount.OsuUsername = username;

            string jsonProfile;

            using (WebClient client = new WebClient())
            {
                jsonProfile = client.DownloadString($"https://osu.ppy.sh/api/get_user?k={osuapikey}&u={username}"); //Downloads user data
            }

            if (jsonProfile == "[]")
            {
                userAccount.OsuUsername = oldUsername;
                embed.WithDescription($"{Context.User.Mention} **ERROR: This username does not match a valid osu! username!**");
                embed.WithFooter($"I have kept your osu! username as {oldUsername}. If you believe this is a mistake, contact Stage#0001.");
                embed.WithColor(Red);
                await BE(); stopWatch.Stop();
                logger.ConsoleCommandLog(Context, stopWatch.ElapsedMilliseconds, CommandError.Unsuccessful, "osu! API did not return any data for the given username."); return;
            }

            UserAccounts.SaveAccounts();

            embed.WithTitle("osu! Username Set");
            embed.WithDescription($"{Context.User.Mention} **Your new username has been set! Changed from `{oldUsername}` to `{userAccount.OsuUsername}`.**");
            embed.WithColor(Pink);
            await BE(); stopWatch.Stop();
            logger.ConsoleCommandLog(Context, stopWatch.ElapsedMilliseconds);
        }
Example #19
0
        public async Task Lost()
        {
            var account = UserAccounts.GetAccount(Context.User, Context.Guild.Id);

            account.Lost += 1;
            UserAccounts.SaveAccounts(Context.Guild.Id);

            if (account.Lost == 1)
            {
                var embed = new EmbedBuilder();
                embed.WithColor(Color.Green);
                embed.WithAuthor(Context.User);
                embed.WithTimestamp(Context.Message.Timestamp);
                embed.WithTitle("Оппа, первопроходец!");
                embed.WithDescription($"Ты впервые проиграл!");


                await CommandHandeling.ReplyAsync(Context, embed);
            }
            else
            {
                var embed = new EmbedBuilder();
                embed.WithColor(Color.DarkOrange);
                embed.WithAuthor(Context.User);
                embed.WithTimestamp(Context.Message.Timestamp);
                embed.WithTitle("Опять?");
                if (account.Lost == 2)
                {
                    embed.WithDescription($"Это уже во {account.Lost}й раз...");
                }
                else
                {
                    embed.WithDescription($"Это уже в {account.Lost}й раз...");
                }

                await CommandHandeling.ReplyAsync(Context, embed);
            }
        }
Example #20
0
        public async Task ListDungeons()
        {
            var account                    = UserAccounts.GetAccount(Context.User);
            var defaultDungeons            = EnemiesDatabase.DefaultDungeons.Where(d => !d.Requirement.IsLocked(account));
            var availableDefaultDungeons   = defaultDungeons.Where(d => d.Requirement.Applies(account)).Select(s => s.Name).ToArray();
            var unavailableDefaultDungeons = defaultDungeons.Where(d => !d.Requirement.Applies(account)).Select(s => s.Name).ToArray();

            var unlockedDungeons     = account.Dungeons.Where(s => EnemiesDatabase.HasDungeon(s)).Select(s => EnemiesDatabase.GetDungeon(s)).Where(d => !d.Requirement.IsLocked(account));
            var availablePermUnlocks = availableDefaultDungeons
                                       .Concat(unlockedDungeons.Where(d =>
                                                                      !d.IsOneTimeOnly &&
                                                                      d.Requirement.FulfilledRequirements(account))
                                               .Select(s => s.Name)
                                               .ToArray());
            var unavailablePermUnlocks = unavailableDefaultDungeons
                                         .Concat(unlockedDungeons.Where(d =>
                                                                        !d.IsOneTimeOnly &&
                                                                        !d.Requirement.FulfilledRequirements(account))
                                                 .Select(s => s.Name)
                                                 .ToArray());

            var availableOneTimeUnlocks   = unlockedDungeons.Where(d => d.IsOneTimeOnly && d.Requirement.FulfilledRequirements(account)).Select(s => s.Name).ToArray();
            var unavailableOneTimeUnlocks = unlockedDungeons.Where(d => d.IsOneTimeOnly && !d.Requirement.FulfilledRequirements(account)).Select(s => s.Name).ToArray();

            var embed = new EmbedBuilder();

            embed.WithTitle("Dungeons");

            if (availablePermUnlocks.Count() > 0)
            {
                embed.AddField("<:mapopen:606236181503410176> Places Discovered", $"Available: {string.Join(", ", availablePermUnlocks)} \nUnavailable: {string.Join(", ", unavailablePermUnlocks)}");
            }
            if (availableOneTimeUnlocks.Count() + unavailableOneTimeUnlocks.Count() > 0)
            {
                embed.AddField("<:cave:607402486562684944> Dungeon Keys", $"Available: {string.Join(", ", availableOneTimeUnlocks)} \nUnavailable: {string.Join(", ", unavailableOneTimeUnlocks)}");
            }
            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Example #21
0
        public async Task DailyPoints(uint timeout = 24, uint bonus = 500)
        {
            try
            {
                Command command = Commands.GetCommand();

                timeout = command.TimelyHours;
                bonus   = command.TimelyPoints;

                var cmdPrefix = Servers.GetServer(Context.Guild).commandPrefix;

                var userAccount = UserAccounts.GetAccount(Context.User);
                if (!CanReceiveTimelyPoints(userAccount, (int)timeout))
                {
                    var difference    = DateTime.Now - userAccount.LastReceivedTimelyPoints;
                    var formattedTime = $"{difference.Hours}h {difference.Minutes}m {difference.Seconds}s";
                    embed.WithTitle("Timely Points");
                    embed.WithDescription($"{Context.User.Mention} It's only been `{formattedTime}` since you've used `{cmdPrefix}timely`!" +
                                          $" Please wait until `{timeout} hours` have passed to receive more timely points.");
                    embed.WithColor(Pink);
                    BE();
                    return;
                }
                userAccount.Points += bonus;
                userAccount.LastReceivedTimelyPoints = DateTime.Now;
                UserAccounts.SaveAccounts();
                embed.WithTitle("Timely Points");
                embed.WithDescription($"{Context.User.Mention} has received {bonus} points! Claim again in {timeout}h.");
                embed.WithColor(Pink);
                BE();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception " + e.InnerException);
                Console.WriteLine("Message " + e.Message);
                Console.WriteLine("Stack Trace " + e.StackTrace);
            }
        }
Example #22
0
        public async Task PickleSize(SocketGuildUser user)
        {
            if (!CheckFunEnabled(Context).Result)
            {
                return;
            }

            var userAccount = UserAccounts.GetAccount(user);

            if (userAccount.PickleSize.Equals(0f))
            {
                userAccount.PickleSize = (float)Math.Round(NextFloat(0.01f, 12f), 2);
                await Context.Channel.SendMessageAsync(
                    $"{GetNickname(user)} has a pickle size of {userAccount.PickleSize}in!");

                UserAccounts.SaveAccounts();
            }
            else
            {
                await Context.Channel.SendMessageAsync(
                    $"{GetNickname(user)} has a pickle size of {userAccount.PickleSize}in!");
            }
        }
Example #23
0
        public async Task Intelligence()
        {
            if (!CheckFunEnabled(Context).Result)
            {
                return;
            }

            var guildContextUser = (SocketGuildUser)Context.User;
            var userAccount      = UserAccounts.GetAccount(Context.User);

            if (userAccount.Iq == 0)
            {
                ushort iq = (ushort)Global.R.Next(1, 200);
                userAccount.Iq = iq;
                await Context.Channel.SendMessageAsync($"{GetNickname(guildContextUser)} has an IQ of {iq}!");

                UserAccounts.SaveAccounts();
            }
            else
            {
                await Context.Channel.SendMessageAsync($"{GetNickname(guildContextUser)} has an IQ of {userAccount.Iq}!");
            }
        }
Example #24
0
        public async Task AddUser([Remainder] string arg = "")
        {
            if (!IsUserRaidLeader((SocketGuildUser)Context.User))
            {
                return;
            }

            SocketUser target        = null;
            var        mentionedUser = Context.Message.MentionedUsers.FirstOrDefault();

            target = mentionedUser ?? Context.User;

            if (target == null)
            {
                return;
            }

            var account = UserAccounts.GetAccount(target);

            UserAccounts.SaveAccounts();

            await Context.Channel.SendMessageAsync($"{target.Username}, added to list.");
        }
Example #25
0
        public async Task Codes(SocketUser target = null)
        {
            target ??= Context.User;

            var user  = UserAccounts.GetAccount(target);
            var embed = new EmbedBuilder();

            embed.WithColor(Colors.Get("Iodem"));
            embed.WithAuthor(target);

            if (user.arePublicCodes || target.Equals(Context.User))
            {
                embed.WithDescription($"PoGo: {user.PoGoCode} \n" +
                                      $"Switch: {user.SwitchCode} \n" +
                                      $"3DS: {user.N3DSCode}");
            }
            else
            {
                embed.WithDescription(Utilities.GetAlert("CODE_IS_PRIVATE"));
            }

            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Example #26
0
        public async Task PayAUser(SocketGuildUser user, int amt)
        {
            var embed = new EmbedBuilder();

            embed.WithColor(Config.bot.DefaultEmbedColour);
            embed.WithFooter(Bot.Internal.Utilities.GetFormattedLocaleMsg("CommandFooter", Context.User.Username));
            var ua  = UserAccounts.GetAccount(Context.User);
            var ua1 = UserAccounts.GetAccount(user);

            if (ua.Money < amt)
            {
                embed.WithDescription($"You don't have enough money, {Context.User.Mention}!");
                await Helpers.SendMessage(Context, embed);
            }
            else
            {
                ua.Money  = ua.Money - amt;
                ua1.Money = ua1.Money + amt;
                UserAccounts.SaveAccounts();
                embed.WithDescription($"{Context.User.Mention} paid {user.Mention} {Config.bot.CurrencySymbol}{amt}!");
                await Helpers.SendMessage(Context, embed);
            }
        }
Example #27
0
        public async Task Rep([Remainder] string arg = "")
        {
            try
            {
                SocketUser target        = null;
                var        mentionedUser = Context.Message.MentionedUsers.FirstOrDefault();
                target = mentionedUser ?? Context.User;

                var account = UserAccounts.GetAccount(target);
                var embed   = new EmbedBuilder();
                embed.WithTitle(target.Username + "'s Reputation");
                embed.WithDescription($"requested by {Context.User.Username}!");
                embed.AddField("Reputation Points", account.Rep);
                embed.WithColor(new Color(0, 255, 255));
                embed.WithThumbnailUrl(target.GetAvatarUrl());

                await Context.Channel.SendMessageAsync("", false, embed.Build());
            }
            catch (Exception e)
            {
                Misc.ExceptionAlert(Context, e);
            }
        }
Example #28
0
        public async Task GiftCooki(IGuildUser user)
        {
            try
            {
                var contextUser = _accounts.GetAccount(Context.User);

                var account = _accounts.GetAccount((SocketUser)user);
                if (account.Cooki >= 1)
                {
                    await Context.Channel.SendMessageAsync(
                        $"{user.Mention} Already have Cooki, you should choose another Octopus or Turtle!");

                    return;
                }

                if (contextUser.Points >= 1488)
                {
                    contextUser.Points -= 1488;


                    account.Cooki     += 1;
                    account.Octopuses += "Cooki|";


                    var embed = new EmbedBuilder();
                    embed.WithColor(244, 66, 107);
                    embed.WithTitle($"You gave {user} Cooki!!");
                    embed.WithFooter("lil octo notebook");
                    embed.AddField("Fees was applied (1488 OctoPoints)", $"{contextUser.Points} Octo Points left");
                    embed.WithImageUrl("https://i.imgur.com/dCJwloV.jpg");


                    await SendMessAsync(embed);
                }
                else
                {
                    await Context.Channel.SendMessageAsync($"You do not have enough OktoPoints to give **Cooki**!");
                }
            }
            catch
            {
                //   await ReplyAsync("boo... An error just appear >_< \nTry to use this command properly: **GiftCooki**\n" +
                //                    "Alias: ПодаритьКуки");
            }
        }
Example #29
0
        public async Task addPts(uint pts, [Remainder] string args)
        {
            if (UserIsSecretOwner((SocketGuildUser)Context.User))
            {
                SocketUser target        = null;
                var        mentionedUser = Context.Message.MentionedUsers.FirstOrDefault();
                target = mentionedUser ?? Context.User;
                var account = UserAccounts.GetAccount(target);

                uint amount = args.LastOrDefault();
                account.Points += pts;
                UserAccounts.SaveAccounts();
                await Context.Channel.SendMessageAsync($"{target.Username} gained {pts} goodboy points. ({account.Points})");

                //send msg to memes
                // var channel = (ISocketMessageChannel)Context.Guild.GetChannel(399544374624780288);
                // await channel.SendMessageAsync($"{target.Username} gained {pts} goodboy points. ({account.Points})");
            }
            else
            {
                await Smug();
            }
        }
Example #30
0
        private async Task ReleaseDjinnHidden(string DjinnName)
        {
            var userDjinn   = UserAccounts.GetAccount(Context.User).DjinnPocket;
            var chosenDjinn = userDjinn.djinn
                              .Where(d => DjinnName.Equals(d.Djinnname, StringComparison.CurrentCultureIgnoreCase) || DjinnName.Equals(d.Nickname, StringComparison.CurrentCultureIgnoreCase))
                              .FirstOrDefault();

            if (chosenDjinn == null)
            {
                return;
            }
            await ReplyAsync(embed : new EmbedBuilder()
                             .WithDescription($"Are you sure that you want to release your djinni {chosenDjinn.Emote} {chosenDjinn.Name}")
                             .Build());

            var response = await Context.Channel.AwaitMessage(m => m.Author == Context.User);

            if (response.Content.Equals("Yes", StringComparison.CurrentCultureIgnoreCase))
            {
                userDjinn.djinn.Remove(chosenDjinn);
                _ = ReplyAsync(embed: new EmbedBuilder().WithDescription($"You set {chosenDjinn.Emote} {chosenDjinn.Name} free, who swiftly rushes off to find another master.").Build());
            }
        }