Exemple #1
0
        public bool TryGetAcceptedReport(ulong id, out Report report)
        {
            report = null;
            if (!AcceptedReports.Any(x => x.Id == id))
            {
                return(false);
            }

            report = AcceptedReports.FirstOrDefault(x => x.Id == id);
            return(true);
        }
Exemple #2
0
        public async Task AcceptReport(OldAccount a, OrikivoCommandContext Context, ulong id)
        {
            if (TryGetReport(id, out Report report))
            {
                DeleteReport(report);
                AcceptedReports.Add(report);
                await NotifyAcceptedReportAsync(a, Context, report);

                return;
            }

            await Context.Channel.SendMessageAsync("The id used does not exist in the list of reports.");
        }
Exemple #3
0
        public async Task CompleteReport(OldAccount a, OrikivoCommandContext Context, ulong id, ulong changelogId)
        {
            if (!TryGetChangelog(changelogId, out Changelog changelog))
            {
                await Context.Channel.SendMessageAsync("You need to specify a changelog ID to complete a report.");

                return;
            }

            if (TryGetAcceptedReport(id, out Report report))
            {
                AcceptedReports.Remove(report);
                await NotifyCompleteReportAsync(a, Context, report, changelog);

                return;
            }

            await Context.Channel.SendMessageAsync("The id used does not exist in the list of reports.");
        }