예제 #1
0
        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.");
        }
예제 #2
0
        public async Task RestoreReportAsync(OrikivoCommandContext ctx, OldGlobal g, RestUserMessage msg)
        {
            if (msg.Author.Id != _client.CurrentUser.Id)
            {
                await ReplyAsync("A report can only be restored from the messages I send.");

                return;
            }
            Report r = new Report(ctx, msg);

            if (g.Reports.Any(x => x.Id == r.Id) || g.AcceptedReports.Any(x => x.Id == r.Id))
            {
                await ReplyAsync("A report of this id already exists.");

                return;
            }

            g.LogReport(r);

            await ReplyAsync($"Report {r.Id} has been restored.");
        }