public async Task ReportBugAsync(OldAccount a, Server s, SocketGuild g, Emoji flag, CommandInfo command, string subject, string summary) { List <Emoji> flags = new List <Emoji> { EmojiIndex.VisualFlag, EmojiIndex.SuggestFlag, EmojiIndex.SpeedFlag, EmojiIndex.PriorityFlag, EmojiIndex.ExceptionFlag }; string pfx = (s.Config.UsePrefixes ? s.Config.Prefix : Context.Client.CurrentUser.Mention + " "); if (!flag.EqualsAny(flags)) { await ReplyAsync($"You must specify a flag type for the bug you wish to report. `{pfx}flags` for more info."); return; } OriReportPriorityType type = flag.GetFlagType(); if (type == OriReportPriorityType.Unknown) { await ReplyAsync($"You must specify a flag type for the bug you wish to report. `{pfx}flags` for more info."); return; } Report r = new Report(Context.Account, type, Context.Message.Id, command, subject); Context.Data.Global.LogReport(r); await(Context.Client.GetChannel(_bugs) as SocketTextChannel).SendMessageAsync(embed: r.Generate(a).Build()); await ReplyAsync($"Your input has been noted. You may view your report with `{pfx}getreport {r.Id}`"); }
public Report(OldAccount a, OriReportPriorityType type, ulong id, string command, string content, string subject = null) { Type = type; Subject = subject ?? type.GetName(); Author = new Author(a); Command = command; Content = content; Id = id; }
public Report(OldAccount a, OriReportPriorityType type, ulong id, CommandInfo command, string content, string subject = null) { Type = type; Subject = subject ?? type.GetName(); Author = new Author(a); Command = $"{command.Module.Name ?? command.Module.ToString()}.{command.Name}".ToLower(); Content = content; Id = id; }
public Report(OriReportPriorityType type, Author author, string subject, string command, string content, ulong id) { Id = id; Author = author; Type = type; Command = command; Subject = subject; Content = content; }
public async Task BuildReportAsync(OldGlobal g, OldAccount a, OriReportPriorityType type, string command, ulong id, string content, string subject = null) { if (g.Reports.Any(x => x.Id == id) || g.AcceptedReports.Any(x => x.Id == id)) { await ReplyAsync("A report of this id already exists."); return; } Report r = new Report(a, type, id, command, content, subject); g.LogReport(r); await(_client.GetChannel(_bugs) as SocketTextChannel).SendMessageAsync(embed: r.Generate(a).Build()); await ReplyAsync($"Your report ({id}) has been built."); }
public static string GetDefaultSummary(this OriReportPriorityType e) { switch (e) { case OriReportPriorityType.Critical: return("A major error may exist within this context."); case OriReportPriorityType.Warning: return("A typical runtime error may occur on this command."); case OriReportPriorityType.Speed: return("This command may run slower than intended."); case OriReportPriorityType.Visual: return("This command may have a misspell."); default: return("Nothing was specified."); } }
public static string GetName(this OriReportPriorityType e) { switch (e) { case OriReportPriorityType.Critical: return("Priority Report"); case OriReportPriorityType.Warning: return("Exception Report"); case OriReportPriorityType.Speed: return("Runtime Report"); case OriReportPriorityType.Visual: return("Visual Report"); default: return("Suggestion"); } }
public static Emoji Icon(this OriReportPriorityType e) { switch (e) { case OriReportPriorityType.Critical: return(EmojiIndex.PriorityFlag); case OriReportPriorityType.Warning: return(EmojiIndex.ExceptionFlag); case OriReportPriorityType.Speed: return(EmojiIndex.SpeedFlag); case OriReportPriorityType.Visual: return(EmojiIndex.VisualFlag); default: return(EmojiIndex.SuggestFlag); } }