public CommandHandler(TelegramBotClient bot, string trnApiKey) { var ftCommandType = typeof(IFortniteCommand); var commandTypes = typeof(CommandHandler).Assembly.GetTypes() .Where(t => ftCommandType.IsAssignableFrom(t)) .Where(t => t.IsClass && !t.IsAbstract) .ToArray(); _bot = bot; _client = RestService.For <IFortNiteTrackerApi>(new HttpClient(new AuthenticatedHttpClientHandler(trnApiKey)) { BaseAddress = new Uri("https://api.fortnitetracker.com") }); _commands = commandTypes.ToDictionary(t => t.Name.Replace("Command", "").ToLower(), t => CreateCommandInstance(t)); }
public RecentMatchesCommand(IFortNiteTrackerApi client) : base(client) { }
public StatsCommand(IFortNiteTrackerApi client) : base(client) { }
protected BaseCommand(IFortNiteTrackerApi client) => _client = client;