Beispiel #1
0
 public ChannelsController(ProxyDataContext db, DiscordHelper discordHelper, IConfiguration cfg, WebhookCache webhookCache)
 {
     this.db            = db;
     this.discordHelper = discordHelper;
     this.cfg           = cfg;
     this.webhookCache  = webhookCache;
 }
Beispiel #2
0
 public ProxiesController(ProxyDataContext db, IConfiguration cfg, DiscordHelper discordHelper,
                          AvatarHelper avatarHelper, ILogger <ProxiesController> logger)
 {
     this.db            = db;
     this.cfg           = cfg;
     this.discordHelper = discordHelper;
     this.avatarHelper  = avatarHelper;
     this.logger        = logger;
 }
Beispiel #3
0
        public AvatarHelper(ProxyDataContext db, IConfiguration cfg)
        {
            this.db  = db;
            this.cfg = cfg;

            AvatarPath = !string.IsNullOrWhiteSpace(cfg["Discord:avatar-path"])
                ? cfg["Discord:avatar-path"]
                : Path.Combine(Environment.GetEnvironmentVariable("home"), "dmrp", "avatars");
        }
Beispiel #4
0
        private static async Task <BotUser> GetUser(ProxyDataContext db, BotUser botUser)
        {
            var dbUser = await db.BotUsers
                         .Include(u => u.Channels).ThenInclude(c => c.Channel)
                         .Include(u => u.Proxies)
                         .FirstOrDefaultAsync(u => u.Id == botUser.Id);

            return(dbUser);
        }
Beispiel #5
0
 public UsersController(ProxyDataContext db, IConfiguration cfg, DiscordHelper discordHelper)
 {
     this.db            = db;
     this.cfg           = cfg;
     this.discordHelper = discordHelper;
 }
Beispiel #6
0
 public AvatarController(ProxyDataContext db, IConfiguration cfg, AvatarHelper avatarHelper)
 {
     this.db           = db;
     this.cfg          = cfg;
     this.avatarHelper = avatarHelper;
 }
 public RequiresDiscordFilterImpl(DiscordHelper discordHelper, ProxyDataContext db)
 {
     this.discordHelper = discordHelper;
     this.db            = db;
 }