コード例 #1
0
        protected override async ValueTask <DiscordCommandContext> GetCommandContextAsync(CachedUserMessage message,
                                                                                          IPrefix prefix)
        {
            var ctx = new AbfCommandContext(this, message, prefix);
            await ctx.PrepareAsync();

            return(ctx);
        }
コード例 #2
0
        public DatabaseCommandContext(AbfCommandContext ctx, AbfDbContext context)
        {
            _ctx   = ctx;
            _users = context.RequestRepository <IGetOrAddRepository <User> >();
            _raids = context.RequestRepository <IRepository <Raid> >();

            if (!(_ctx.Guild is null))
            {
                _guilds = context.RequestRepository <IGetOrAddRepository <Guild> >();
            }

            Database = context;
        }