Example #1
0
        public async Task SystemFronter(Context ctx, PKSystem system)
        {
            if (system == null)
            {
                throw Errors.NoSystemError;
            }
            ctx.CheckSystemPrivacy(system, system.FrontPrivacy);

            var sw = await _data.GetLatestSwitch(system);

            if (sw == null)
            {
                throw Errors.NoRegisteredSwitches;
            }

            await ctx.Reply(embed : await _embeds.CreateFronterEmbed(sw, system.Zone));
        }
Example #2
0
        public async Task SystemFronter(Context ctx, PKSystem system)
        {
            if (system == null)
            {
                throw Errors.NoSystemError;
            }
            ctx.CheckSystemPrivacy(system, system.FrontPrivacy);

            await using var conn = await _db.Obtain();

            var sw = await _repo.GetLatestSwitch(conn, system.Id);

            if (sw == null)
            {
                throw Errors.NoRegisteredSwitches;
            }

            await ctx.Reply(embed : await _embeds.CreateFronterEmbed(sw, system.Zone, ctx.LookupContextFor(system)));
        }