Esempio n. 1
0
        public async Task Respone1()
        {
            if (await BlackList.IsBanned(Context.User.Id))
            {
                return;
            }
            var UserID = Context.User.Id;

            if (AllowedUsers.Contains(UserID))
            {
                AllowedUsers.Remove(UserID);
                if (NerdMode)
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("REMOVED_LST_BIN") + Context.User.Username);
                }
                else
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("REMOVED_LST") + Context.User.Username);
                }
            }
            else
            if (NerdMode)
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("REMOVED_ERR_BIN") + Context.User.Username);
            }
            else
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("REMOVED_ERR") + Context.User.Username);
            }
        }
Esempio n. 2
0
        public async Task BlackListCmd([Remainder] string user)
        {
            ulong UserID = Context.User.Id;

            if (await BlackList.IsBanned(Context.User.Id))
            {
                return;
            }

            if (AllowedUsers.Contains(UserID))
            {
                ulong userID = ulong.Parse(user);
                BlackList.AddToBan(userID);
                await Context.Channel.SendMessageAsync("The user with ID: " + user + " has been banned from using this bot. :hammer: ");
            }
            else
            {
                if (NerdMode)
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO_BIN") + Context.User.Username);
                }
                else
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO") + Context.User.Username);
                }
            }
        }
Esempio n. 3
0
        public async Task Response4()
        {
            if (await BlackList.IsBanned(Context.User.Id))
            {
                return;
            }
            ulong UserID = Context.User.Id;

            if (AllowedUsers.Contains(UserID))
            {
                Bitmap img = await LocalPCExecutor.TakeScreenshot();

                img.Save("tempimg.png", System.Drawing.Imaging.ImageFormat.Png);

                await Context.Channel.SendFileAsync("tempimg.png", "PC Screenshot: ");

                File.Delete("tempimg.png");
            }
            else
            if (NerdMode)
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO_BIN") + Context.User.Username);
            }
            else
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO") + Context.User.Username);
            }
        }
Esempio n. 4
0
        public async Task Response0([Remainder] string password = "******")
        {
            if (await BlackList.IsBanned(Context.User.Id))
            {
                return;
            }
            if (password == Configuration.botCfg.passKey)
            {
                AllowedUsers.Add(Context.User.Id);
                await Context.Channel.DeleteMessageAsync(Context.Message);

                if (NerdMode)
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("GRANTED_BIN") + Context.User.Username);
                }
                else
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("GRANTED") + Context.User.Username);
                }
            }
            else
            if (NerdMode)
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("DENIED_BIN") + Context.User.Username);
            }
            else
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("DENIED") + Context.User.Username);
            }
        }
Esempio n. 5
0
        public async Task Response10([Remainder] string duration = "30")
        {
            if (await BlackList.IsBanned(Context.User.Id))
            {
                return;
            }
            ulong UserID = Context.User.Id;

            if (AllowedUsers.Contains(UserID))
            {
                string output = LocalPCExecutor.ExecuteCommandPrompt("shutdown -r -t " + duration);


                if (!output.StartsWith("OK"))
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse(output));
                }
                else
                {
                    if (NerdMode)
                    {
                        await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("BLANK_BIN"));
                    }
                    else
                    {
                        await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("BLANK"));
                    }
                }
            }
            else
            if (NerdMode)
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO_BIN") + Context.User.Username);
            }
            else
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO") + Context.User.Username);
            }
        }
Esempio n. 6
0
        public async Task Response2([Remainder] string command = "echo Hellow World!")
        {
            if (await BlackList.IsBanned(Context.User.Id))
            {
                return;
            }
            ulong UserID = Context.User.Id;

            if (AllowedUsers.Contains(UserID))
            {
                string output = LocalPCExecutor.ExecuteCommandPrompt(command);
                if (output.StartsWith("ERR_TOO_LNG"))
                {
                    var xout = output.Substring(11);
                    if (NerdMode)
                    {
                        output += "_BIN";
                        xout    = output.Substring(15);
                    }

                    var oldmsg = await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse(output) + "\nUploading text file with data =>\r");

                    var dat_file = System.IO.File.Create("exec_cmd" + ".txt");
                    dat_file.Dispose();

                    File.WriteAllText("exec_cmd" + ".txt", xout);


                    await Context.Channel.SendFileAsync("exec_cmd" + ".txt", "`" + command + "`" + " Output File", false, null, null, false);

                    await Context.Channel.DeleteMessageAsync(oldmsg);

                    File.Delete(command + ".txt");
                }
                else if (!output.StartsWith("OK"))
                {
                    await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse(output));
                }
                else
                {
                    string xout = output.Substring(2);
                    if (NerdMode)
                    {
                        await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OK_BIN") + "```" + xout + "```");
                    }
                    else
                    {
                        await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OK") + "```" + xout + "```");
                    }
                }
            }
            else
            if (NerdMode)
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO_BIN") + Context.User.Username);
            }
            else
            {
                await Context.Channel.SendMessageAsync(JsonExtr.GrabResponse("OP_NO") + Context.User.Username);
            }
        }