Esempio n. 1
0
        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}`");
        }