Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task hackBan([Remainder]string input)
- {
- try
- {
- string output = "```\n";
- var inputs = input.Split(' ').ToList();
- List<ulong> inp= new List<ulong>();
- foreach (string x in inputs)
- {
- inp.Add(Convert.ToUInt64(x));
- }
- foreach (ulong test in inp)
- {
- Console.WriteLine(test);
- }
- if ((Context.User as SocketGuildUser).GuildPermissions.Administrator)
- {
- foreach (ulong line in inp)
- {
- SocketUser currentUser = Context.Client.GetUser(Convert.ToUInt64(line));
- await Task.Delay(1000);
- Console.WriteLine(currentUser.Username);
- if ((currentUser as SocketGuildUser).GuildPermissions.Administrator)
- {
- output += $"Could not ban {line} ({currentUser.Username + "#" + currentUser.Discriminator})\n";
- }
- else
- {
- try
- {
- Context.Guild.AddBanAsync(currentUser, 0, $"Massbanned by {Context.User.Username + "#" + Context.User.Discriminator}");
- output += $"Sucessfully banned {line} ({currentUser.Username + "#" + currentUser.Discriminator})\n";
- }
- catch
- {
- output += $"Unable to ban {line} ({currentUser.Username + "#" + currentUser.Discriminator})\n";
- }
- }
- }
- Context.Channel.SendMessageAsync(output + "```");
- }
- else
- {
- await Context.Channel.SendMessageAsync("You don't have permission to run this command");
- }
- }
- catch (Exception e)
- {
- ExceptionAlert(Context, e);
- }
- }
Add Comment
Please, Sign In to add comment