public async Task LogPoster([Summary("The Warcraftlog url of the fight you want to add to the #logs channel.")] string url) { var user = (SocketGuildUser)Context.User; if (!UtilService.IsOfficer(user.Roles) || !UtilService.IsRaider(user.Roles)) { await ReplyAsync("You do not have the required role for this command."); return; } var channel = Context.Guild.GetTextChannel(504316725500575745); if (!url.Contains("reports/")) { await ReplyAsync("That isn't a valid warcraftlogs url."); } else { var ID = url.Substring(url.LastIndexOf("reports/") + 8); var wowAnalyzerUrl = $"https://www.wowanalyzer.com/report/{ID}"; var wipefestUrl = $"https://www.wipefest.net/report/{ID}"; var embed = new EmbedBuilder() .WithColor(Color.DarkTeal) .WithTitle("BFA Guild Raid LOG") .WithThumbnailUrl("https://dmszsuqyoe6y6.cloudfront.net/img/common/warcraft-logo.png") .WithDescription($"Added: {DateTime.UtcNow}\n\n**Links:** [Warcraft Log]({url}) | [Wow Analyzer]({wowAnalyzerUrl}) | [WipeFest]({wipefestUrl})\n") .WithFooter("Powered by Bleps, WarcraftLogs, Wow Analyzer & WipeFest", "https://dmszsuqyoe6y6.cloudfront.net/img/common/warcraft-logo.png") .Build(); await channel.SendMessageAsync("", false, embed); } }
public async Task Reporter([Summary("The user who you're reporting. (@ them)")] SocketUser reportedUser, [Summary("The reason you're reporting them.")][Remainder] string reason) { ISocketMessageChannel channel = (ISocketMessageChannel)Context.Guild.GetChannel(514112072326578207); var requestingUser = (SocketGuildUser)Context.User; if (UtilService.IsOfficer(requestingUser.Roles)) { UserAccounts.AccountUpdate(reportedUser, "1", UserAccounts.UpdateType.AdminReport); } else { UserAccounts.AccountUpdate(reportedUser, "1", UserAccounts.UpdateType.UserReport); } UserAccounts.AccountUpdate(Context.User, "1", UserAccounts.UpdateType.ReportMade); await channel.SendMessageAsync("", false, UtilService.Report(reportedUser, Context.User, (SocketChannel)Context.Channel, reason)); }
public async Task Ban([Summary("The user you want to ban. (@ them)")] SocketUser bUser, [Summary("The reason you're banning them.")][Remainder] string reason) { var requestingUser = (SocketGuildUser)Context.User; var bannedUser = (IGuildUser)bUser; var reportChannel = (ISocketMessageChannel)Context.Guild.GetChannel(514112072326578207); if (UtilService.IsOfficer(requestingUser.Roles)) { await bannedUser.BanAsync(2, reason); await ReplyAsync($"{bannedUser.Username} with ID {bUser.Id} has been banned from {Context.Guild.Name}"); await reportChannel.SendMessageAsync("", false, UtilService.BanReporter(bUser, Context.User, (SocketChannel)Context.Channel, reason)); LoggingService.Log("admin", LogSeverity.Info, $"{Context.User.Username} has banned {bannedUser.Username}"); return; } else { await ReplyAsync("You do not have the required role to do that."); LoggingService.Log("admin", LogSeverity.Warning, $"{Context.User.Username} Requested a command without permision."); } }