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); } }
public async Task Response8() { if (await BlackList.IsBanned(Context.User.Id)) { return; } bool OkOrNo = LocalPCExecutor.AbortShutDown(); if (OkOrNo) { await Context.Channel.SendMessageAsync(":zap: Windows.... stop that shutdown! ---- cheers!, Right mate all done."); } else { await Context.Channel.SendMessageAsync(":no_entry_sign: --- Operation Refused! -- PC is shutting down."); } }
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); } }
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); } }