Ejemplo n.º 1
0
        public async Task CreatePoll(params string[] Parameters)
        {
            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            if (!Parameters[0].StartsWith("<"))
            {
                await Context.Channel.SendMessageAsync("You must surround the parameters of this command in <> to ensure the bot can insert the full Poll Name and Poll Options!");
            }

            List <string> arguments = new List <string>();

            StringBuilder temp = new StringBuilder();

            foreach (string arg in Parameters.ToList())
            {
                if (arg.EndsWith(">"))
                {
                    temp.Append(arg);

                    arguments.Add(temp.ToString().Replace("<", "").Replace(">", ""));

                    temp.Clear();
                }
                else
                {
                    temp.Append(arg + " ");
                }
            }

            string PollName         = arguments[0];
            string PollOptionString = "";

            int index = 1;

            foreach (string PollOption in arguments.GetRange(1, (arguments.Count - 1)))
            {
                PollOptionString += (index++) + ": " + PollOption + "\n";
            }

            polls.Add(new Poll((polls.Count + 1), PollName, arguments.GetRange(1, (arguments.Count - 1)).ToArray()));

            await Context.Channel.SendMessageAsync("Poll Created: " + "ID: " + polls.Count + " Name: " + PollName + "\n" + PollOptionString);
        }
Ejemplo n.º 2
0
        public async Task SlowModeToggle(int Messages, int Seconds)
        {
            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            await Context.Channel.SendMessageAsync("Slow Mode: " + (CommandHandler.SlowMode = true) + " MessagesPerInterval: " + (CommandHandler.maxMessagesPerInterval = Messages) + " MessageInterval: " + (CommandHandler.maxMessagesInterval = (Seconds * 1000)) + "ms");
        }
Ejemplo n.º 3
0
        public async Task EndPoll(int PollID)
        {
            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            Poll activePoll = polls.FirstOrDefault(Poll => Poll.PollID == PollID);

            await Context.Channel.SendMessageAsync(activePoll.PollName + " has ended!");
        }
Ejemplo n.º 4
0
        public async Task EndPoll()
        {
            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            polls.RemoveAt(polls.Count() - 1);

            await Context.Channel.SendMessageAsync("Active pole has ended!");
        }
Ejemplo n.º 5
0
        public async Task WarnUser(SocketUser user)
        {
            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            await user.SendMessageAsync("Discords Terms of Service Prohibit Sharing of 'Cheats' and any discussion related to them, therefore you can find our Software and support for our Software on our Website." + "\n"
                                        + "Software Download is on the forum: " + "\n"
                                        + "https://MaverickCheats.eu/");

            await Context.Channel.SendMessageAsync("User Warned!");
        }
Ejemplo n.º 6
0
        public async Task StartPoll()
        {
            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            Console.WriteLine("Starting Poll");

            Poll LastPoll = polls.Last();

            Console.WriteLine(LastPoll.PollName);

            string MessageBuilder = "";

            int index = 1;

            foreach (string options in LastPoll.PollOptions)
            {
                MessageBuilder += index + ": " + "[" + options + "]" + "\n";

                index++;
            }

            Console.WriteLine(MessageBuilder);

            await Iterations.FindChannel(Context.Guild, "news").SendMessageAsync(Context.Guild.EveryoneRole.Mention + "\nPoll " + LastPoll.PollName + " has been started by " + Context.User.Mention + ".\n"
                                                                                 + "To vote now, type $vote with the number thats next to the option you're voting for like this `$vote 1`" + "\n\n"
                                                                                 + MessageBuilder
                                                                                 );


            Console.WriteLine("Sent");
        }
Ejemplo n.º 7
0
        private async Task HandleCommandAsync(SocketMessage s)
        {
            var msg = s as SocketUserMessage;

            if (msg == null)
            {
                return;
            }

            var Context = new SocketCommandContext(_client, msg);

            //Check Anti SPAM
            if (SlowMode && (!Iterations.HasRole((SocketGuildUser)Context.User, "Bots") &&
                             !Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                             !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                             !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                             !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                             !Iterations.HasRole((SocketGuildUser)Context.User, "Owner") &&
                             Message.Contains(Context.User.Id)))
            {
                Message message = Message.Get(Context.User.Id);

                Console.WriteLine("User: "******" Messages: {0}/{1} Warns: {2}/{3}", message.Count, maxMessagesPerInterval, message.Warns, 3);

                if (message.Count >= maxMessagesPerInterval)
                {
                    Message.SetWarnCount(Context.User.Id);

                    if (message.Warns > 3)
                    {
                        //Nothing yet
                    }

                    await Context.Message.DeleteAsync();
                }
                else
                {
                    Message.SetMsgCount(Context.User.Id);
                }
            }
            else
            {
                Cache.AntiSpam.Add(new Message(Context.User.Id, 1));
            }

            int argPos = 0;

            if (msg.HasCharPrefix('$', ref argPos))
            {
                if (msg.Content.ToLower().Contains("$gk"))
                {
                    await msg.DeleteAsync();

                    return;
                }

                requestCount++;

                Console.WriteLine("Request number " + requestCount + " Out of " + maxRequestsPerSecond);

                if (requestCount > maxRequestsPerSecond)
                {
                    return;
                }

                Console.WriteLine("Command: " + Context.Message);
                var result = await _service.ExecuteAsync(Context, argPos);

                if (!result.IsSuccess)// && result.Error != CommandError.UnknownCommand)
                {
                    Console.WriteLine("Command Error: " + result.Error.ToString());
                    await Context.Channel.SendMessageAsync(result.ErrorReason);
                }
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && ((msg.Content.ToLower().Contains("download") && (msg.Content.ToLower().Contains("it") || msg.Content.ToLower().Contains("?"))) || msg.Content.ToLower().Contains(" cheat") || msg.Content.ToLower().Contains("loader") || msg.Content.ToLower().Contains("mod ") || msg.Content.ToLower().Contains("hack") || msg.Content.ToLower().Contains("menu") || msg.Content.ToLower().Contains("gk") || ((msg.Content.ToLower().Contains("gk") && msg.Content.ToLower().Contains("cs")) || (msg.Content.ToLower().Contains("gk") && msg.Content.ToLower().Contains("gta")))))
            {
                //Check Anti SPAM
                if (SlowMode && (!Iterations.HasRole((SocketGuildUser)Context.User, "Bots") &&
                                 !Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
                {
                    await Context.User.SendMessageAsync("Discords Terms of Service Prohibit Sharing of 'Cheats', therefore you can find our Software on our Website." + "\n"
                                                        + "Software Download is on the forum: " + "\n"
                                                        + "https://MaverickCheats.eu/");

                    await Context.Message.DeleteAsync();
                }
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower().Contains("activation") || msg.Content.ToLower().Contains("acitvate") || msg.Content.ToLower().Contains("license") || (msg.Content.ToLower().Contains("key") && msg.Content.ToLower().Contains("?")))
            {
                await Context.User.SendMessageAsync("License Keys are no longer required for the cheat, just login using your Forum Email and Password and you will have access to all the Free cheats.");

                await Context.Message.DeleteAsync();
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower().Contains("hwid") && msg.Content.ToLower().Contains("taken"))
            {
                await Context.Channel.SendMessageAsync("HWID Taken means you have a Login already, please use your current account.");
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower().Contains("hwid") && msg.Content.ToLower().Contains("invalid"))
            {
                await Context.Channel.SendMessageAsync("Invalid HWID means your Computer Identity has changed, ask staff for a reset.");
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower().Contains("invalid") && msg.Content.ToLower().Contains("username"))
            {
                await Context.Channel.SendMessageAsync("Invalid Username means there is no account associated to that username, there may have been a database reset recently and you may need to register again.");
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && ((msg.Content.ToLower().Contains("stealth") && msg.Content.ToLower().Contains("broke")) || (msg.Content.ToLower().Contains("stealth") && msg.Content.ToLower().Contains("cant")) || (msg.Content.ToLower().Contains("stealth") && msg.Content.ToLower().Contains("wont")) || (msg.Content.ToLower().Contains("stealth") && msg.Content.ToLower().Contains("isnt"))))
            {
                await Context.Channel.SendMessageAsync("Stealth is buggy and may not work, if you encounter this issue you can try changing servers and restarting your game to help fix the issue.");
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower().Contains("server down"))
            {
                await DiscordBot.Functions.Status.GetStatus(msg, Context);
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower() == "crash")
            {
                await Context.Channel.SendMessageAsync("If you have crashes when you immediately start your MaverickClient or Updater, you NEED to disable ALL POSSIBLE SECURITY that may block the connection. This cannot be fixed by us as AntiVirus's and Firewalls autoblock suspicous servers such as our 'Server'.");
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && (msg.Content.ToLower().Contains("vehicle") && msg.Content.ToLower().Contains("spawn") || msg.Content.ToLower().Contains("kicks") && msg.Content.ToLower().Contains("out") & msg.Content.ToLower().Contains("out")) && msg.Author.Id != _client.CurrentUser.Id)
            {
                Console.WriteLine(msg.Author.Id + "!=" + _client.CurrentUser.Id);

                await Context.Channel.SendMessageAsync("If you're having issues with vehicles, ensure the bypass is enabled by going to the Spawn Tab, Vehicles and then Options at the top.");
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower().Contains("send") && msg.Content.ToLower().Contains("logs"))
            {
                Console.WriteLine("Logs Called");

                EmbedBuilder eb = new EmbedBuilder();
                eb.WithTitle("Finding our Logs");
                eb.AddInlineField("Loader Logs", "Opening MaverickClient shows a Black Console, right click the top of the console, click edit, click select all and press enter. You can now press CTRL + V in discord to paste the logs.");
                eb.AddInlineField("Game Logs", "Press Windows Key + R while on the Desktop.\nType in: %appdata%\\CrispyCheats\\ and press enter.");
                eb.Color = new Color(0, 255, 0);

                await msg.Channel.SendMessageAsync("", false, eb);
            }
            else if (msg.Author.Id != _client.CurrentUser.Id && msg.Content.ToLower().Contains("menu") && msg.Content.ToLower().Contains("open"))
            {
                Console.WriteLine("Menu Open Called");

                EmbedBuilder eb = new EmbedBuilder();
                eb.WithTitle("Menu Navigation");
                eb.AddInlineField("Open Menu", "Numpad -");
                eb.AddInlineField("Save Config", "L");
                eb.AddInlineField("Unload Menu", "F9");

                eb.AddInlineField("Tab Left", "Numpad 7");
                eb.AddInlineField("Menu Up", "Numpad 8");
                eb.AddInlineField("Tab Right", "Numpad 9");

                eb.AddInlineField("Menu Left", "Numpad 4");
                eb.AddInlineField("Toggle Option", "Numpad 5");
                eb.AddInlineField("Menu Right", "Numpad 6");
                eb.AddInlineField("Menu Back", "Numpad 0");
                eb.AddInlineField("Menu Down", "Numpad 2");
                eb.AddInlineField("Num Lock", "Toggles Controls");
                eb.Color = new Color(0, 255, 0);
                eb.Title = "Menu Keybinds";

                await msg.Channel.SendMessageAsync("", false, eb);
            }
        }
Ejemplo n.º 8
0
        public async Task GetAccount(string Username)
        {
            //Check if its a username or mention
            bool Mention = !(Context.Message.MentionedUsers.Count == 0);

            //Store all mentioned users
            IReadOnlyCollection <SocketUser> Users = Context.Message.MentionedUsers;

            string Token;

            Console.WriteLine("Get Account Called");

            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            client.Login(out Token);

            Console.WriteLine("Login Token: " + Token);

            if (!Mention)
            {
                if (Username == "Username Not Found" || Username == "DiscordID not Specified" || Username == "Server Error" || Username == "")
                {
                    await Context.Message.Channel.SendMessageAsync("User does not have an account.");

                    return;
                }
                else
                {
                    await Context.Message.Channel.SendMessageAsync("Sent user data to DM's.");
                }

                var dm = await Context.Message.Author.GetOrCreateDMChannelAsync();

                string resp = client.AdminGetAccountDetails(Username, Token);

                if (resp != "Account not Found" && resp != "Invalid Permissions" && resp != "Token Not Specified" && resp != "Username Not Provided")
                {
                    string[] data = resp.Split('|');

                    EmbedBuilder eb = new EmbedBuilder();
                    eb.Description =
                        "MemberID: " + data[0] + "\n"
                        + "Username: "******"\n"
                        + "HWID: " + data[2] + "\n"
                        + "DiscordID: " + data[3] + "\n"
                        + "DiscordName: " + data[4] + "\n"
                        + "Is Banned: " + data[5] + "\n"
                        + "Is Admin: " + data[6] + "\n"
                        + "Owned Products: " + data[7] + "\n"
                        + "License Keys: " + data[8] + "\n";
                    eb.Color = Color.Blue;
                    eb.Title = "User Account Details";

                    await dm.SendMessageAsync("", false, eb);
                }
                else
                {
                    await dm.SendMessageAsync("Failed to Query Account: " + resp);
                }
            }
            else
            {
                foreach (SocketUser User in Users)
                {
                    Username = client.FindUser(User.Id);

                    if (Username == "User Not Found" || Username == "DiscordID not Specified" || Username == "Server Error" || Username == "")
                    {
                        await Context.Message.Channel.SendMessageAsync("User does not have an account.");

                        return;
                    }
                    else
                    {
                        await Context.Message.Channel.SendMessageAsync("Sent user data to DM's.");
                    }

                    var dm = await Context.Message.Author.GetOrCreateDMChannelAsync();

                    string resp = client.AdminGetAccountDetails(Username, Token);

                    if (resp != "Account not Found" && resp != "Invalid Permissions" && resp != "Token Not Specified" && resp != "Username Not Provided")
                    {
                        string[] data = resp.Split('|');

                        EmbedBuilder eb = new EmbedBuilder();
                        eb.Description =
                            "MemberID: " + data[0] + "\n"
                            + "Username: "******"\n"
                            + "HWID: " + data[2] + "\n"
                            + "DiscordID: " + data[3] + "\n"
                            + "DiscordName: " + data[4] + "\n"
                            + "Is Banned: " + data[5] + "\n"
                            + "Is Admin: " + data[6] + "\n"
                            + "Owned Products: " + data[7] + "\n"
                            + "License Keys: " + data[8] + "\n";
                        eb.Color = Color.Blue;
                        eb.Title = "User Account Details";

                        await dm.SendMessageAsync("", false, eb);
                    }
                    else
                    {
                        await dm.SendMessageAsync("Failed to Query Account: " + resp);
                    }
                }
            }
        }
        public async Task PasswordReset(string Username)
        {
            //If we're using a Username or Discord Mention
            bool Mention = !(Context.Message.MentionedUsers.Count == 0);

            //Mentioned List
            IReadOnlyCollection <SocketUser> Users = Context.Message.MentionedUsers;

            string Token;

            Console.WriteLine("Password Reset Called");

            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            //get a Admin token for administering admin actions
            client.Login(out Token);

            Console.WriteLine("Login Token: " + Token);

            if (!Mention)
            {
                string Response = client.ResetPassword(Username, Token);

                Console.WriteLine("Password Reset: " + Response);

                if (Response == "Password Reset")
                {
                    await Context.Message.Channel.SendMessageAsync("Password Reset: " + Username);
                }
                else
                {
                    await Context.Message.Channel.SendMessageAsync("Password Failed to be Reset: " + Response);
                }
            }
            else
            {
                foreach (SocketUser User in Users)
                {
                    //Send API Request to ban all associated cheat accounts
                    Username = client.FindUser(User.Id);

                    if (Username != "User Not Found")
                    {
                        string Response = client.ResetPassword(Username, Token);

                        if (Response == "Password Reset")
                        {
                            await Context.Message.Channel.SendMessageAsync("Password Reset: " + Username);
                        }
                        else
                        {
                            await Context.Message.Channel.SendMessageAsync("Password Failed to Reset: " + Response);
                        }
                    }
                    else
                    {
                        await Context.Message.Channel.SendMessageAsync("Password Failed to be Reset: User not Found");
                    }
                }
            }
        }
Ejemplo n.º 10
0
        public async Task BanUser(string Username, params string[] ReasonParams)
        {
            string Reason = "";

            foreach (string reason in ReasonParams)
            {
                Reason += reason + " ";
            }

            //If we're using a Username or Discord Mention
            bool Mention = !(Context.Message.MentionedUsers.Count == 0);

            //Mentioned List
            IReadOnlyCollection <SocketUser> Users = Context.Message.MentionedUsers;

            string Token;

            Console.WriteLine("Ban Called");

            if (Context.Message.Author.Id != 193255051807031296 &&
                (!Iterations.HasRole((SocketGuildUser)Context.User, "Mod") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Admin") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Junior Dev") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Supervisor") &&
                 !Iterations.HasRole((SocketGuildUser)Context.User, "Owner")))
            {
                await Context.Message.Channel.SendMessageAsync("Permission Denied.");

                return;
            }

            //get a Admin token for administering admin actions
            client.Login(out Token);

            Console.WriteLine("Login Token: " + Token);

            if (!Mention)
            {
                if (client.Ban(Username, Token))
                {
                    Console.WriteLine("User Banned");
                    await Context.Message.Channel.SendMessageAsync("Banned " + Username + " From Client");
                }
                else
                {
                    Console.WriteLine("User Not Banned");
                    await Context.Message.Channel.SendMessageAsync("Failed to Ban " + Username);
                }
            }
            else
            {
                foreach (SocketUser User in Users)
                {
                    //Generate instance of a DM Channel
                    var dm = await User.GetOrCreateDMChannelAsync();

                    //Send API Request to ban all associated cheat accounts
                    Username = client.FindUser(User.Id);

                    if (Username != "User Not Found" && client.Ban(Username, Token))
                    {
                        await Context.Message.Channel.SendMessageAsync("Banned " + Username + " From Client");

                        await dm.SendMessageAsync("Your Login has been banned from the MaverickCheats Cheat Client for '" + Reason + "'. Have a good day!");
                    }
                    else
                    {
                        await Context.Message.Channel.SendMessageAsync("Failed to Ban " + Username);
                    }

                    //Tell the Person
                    await dm.SendMessageAsync("You have been banned from MaverickCheats Discord for '" + Reason + "'. Have a good day!");

                    //Tell the Server
                    await Context.Message.Channel.SendMessageAsync("Banned " + "<@" + User.Id + ">" + " From Discord");

                    //Finally Ban User
                    await Context.Guild.AddBanAsync(User);
                }
            }
        }