Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool idMatches;
- [Command("unban")]
- [RequireBotPermission(GuildPermission.Administrator)]
- [RequireUserPermission(GuildPermission.ViewAuditLog)]
- private async Task UnbanUser(ulong user)
- {
- var insult = await Insults.GetInsult();
- string userName = "";
- var currentBans = await Context.Guild.GetBansAsync();
- foreach (var item in currentBans)
- {
- if (user == item.User.Id)
- {
- idMatches = true;
- userName = item.User.Username;
- break;
- }
- else
- {
- idMatches = false;
- }
- }
- if (idMatches != true)
- {
- await Context.Channel.SendMessageAsync("that's not a banned ID " + insult);
- }
- await Context.Guild.RemoveBanAsync(user);
- await Context.Channel.SendMessageAsync($"✅ *** {user} has been unbanned ***");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement