private StoreCommands(DiscordSocketClient client, RokiContext context, ICurrencyService currency, IConfigurationService config) { _client = client; _context = context; _currency = currency; _config = config; }
public Xp(IHttpClientFactory http, RokiContext context, IRedisCache cache, IConfigurationService config) { _http = http; _context = context; _config = config; _cache = cache.Redis.GetDatabase(); }
public TradingService(IHttpClientFactory factory, IRokiConfig config, RokiContext context, ICurrencyService currency, IConfigurationService service) { _factory = factory; _config = config; _context = context; _currency = currency; _service = service; }
public async Task InvokeAsync(HttpContext context, RokiContext dbContext) { if (!context.Request.Path.StartsWithSegments("/manage")) { await _next(context); return; } string[] route = context.Request.Path.ToString().Split('/'); if (route.Length < 3) { await _next(context); return; } if (!ulong.TryParse(route[2], out ulong guildId)) { context.Response.Redirect("/manage"); await context.Response.CompleteAsync(); return; } ulong userId = ulong.Parse(context.User.FindFirstValue("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier")); // check if user is owner or is a moderator of server // todo admin bypass? if (!await dbContext.Guilds.AsNoTracking().AnyAsync(x => x.Id == guildId && (x.OwnerId == userId || x.Moderators.Contains((long)userId)))) { context.Response.Redirect("/manage"); await context.Response.CompleteAsync(); return; } await _next(context); }
public QuoteCommands(RokiContext context, IConfigurationService config) { _context = context; _config = config; }
public SettingsController(RokiContext context) { _context = context; }
public Currency(RokiContext context, ICurrencyService currency, IConfigurationService config) { _context = context; _currency = currency; _config = config; }
public PortfolioService(IHttpClientFactory factory, IRokiConfig config, RokiContext context) { _factory = factory; _config = config; _context = context; }
public GuildController(RokiContext context, DiscordService discordService) { _context = context; _discordService = discordService; }