public async Task Ban(string user, [Remainder] string banReason) { //bans a user var banned = Context.Guild.GetUsersAsync().Result.ToList().FirstOrDefault(x => x.Id == CommandUtils.GetID(user)); var banner = Context.User; await Context.Channel.SendMessageAsync($"Ban: **{ banned.Username}#{ banned.Discriminator}** By: **{banner.Username}#{banner.Discriminator}** For: {banReason}"); await banned.BanAsync(); }
public async Task Kick(string user, [Remainder] string kickReason) { //kicks a user var kicked = Context.Guild.GetUsersAsync().Result.ToList().FirstOrDefault(x => x.Id == CommandUtils.GetID(user)); var kicker = Context.User; await Context.Channel.SendMessageAsync($"Kick: { kicked.Username}#{ kicked.Discriminator} By: **{kicker.Username}#{kicker.Discriminator}** For: {kickReason}"); await kicked.KickAsync(); }
public async Task Bannir(string user, [Remainder] string bannirReason) { var bannired = Context.Guild.GetUsersAsync().Result.ToList().FirstOrDefault(x => x.Id == CommandUtils.GetID(user)); var bannirer = Context.User; if (bannired.Id == 81805731128414208 || bannired.Id == 588470417317036062) //bannir vanir { await Context.Channel.SendFileAsync(@"D:\KATIEBOT\BANNIRVANNIR.png", $"Bannir: **{ bannired.Username}#{ bannired.Discriminator}** By: **{bannirer.Username}#{bannirer.Discriminator}** For: {bannirReason}"); } else { await Context.Channel.SendMessageAsync($"Bannir: **{ bannired.Username}#{ bannired.Discriminator}** By: **{bannirer.Username}#{bannirer.Discriminator}** For: {bannirReason}"); } await bannired.BanAsync(); }
public async Task Warn(string user, [Remainder] string warnReason) { /*setup variables such as user id, moderator id and discriminators to allow for the bot to do the following: * 1: display a message which states that user x has been warned by user y for doing z * 2: log that into a specific channel * 3: DM the user being warned that they have been warned in server x by user y for doing z */ try { var WarnInfoEmbed = new EmbedBuilder() { Color = Color.Red }; var warned = Context.Guild.GetUsersAsync().Result.ToList().FirstOrDefault(x => x.Id == CommandUtils.GetID(user)); var authority = Context.Message.Author; await Context.Channel.SendMessageAsync($"Warn: {warned.Username}#{warned.Discriminator} For: {warnReason} By: {authority.Username}#{authority.Discriminator}"); } catch (Exception e) { await Context.Channel.SendMessageAsync(e.ToString()); } }