public TokensController(IAuthenticationHandler authenticationHandler, IRegSysAlternativePinAuthenticationProvider regSysAlternativePinAuthenticationProvider, IApiPrincipal apiPrincipal) { _authenticationHandler = authenticationHandler; _regSysAlternativePinAuthenticationProvider = regSysAlternativePinAuthenticationProvider; _apiPrincipal = apiPrincipal; }
public BotManager( TelegramConfiguration telegramConfiguration, IUserManager userManager, IDealerService dealerService, IEventService eventService, IEventConferenceRoomService eventConferenceRoomService, IRegSysAlternativePinAuthenticationProvider regSysAlternativePinAuthenticationProvider, IEntityRepository <PushNotificationChannelRecord> pushNotificationChannelRepository, IEntityRepository <FursuitBadgeRecord> fursuitBadgeRepository, IPrivateMessageService privateMessageService, ICollectingGameService collectingGameService, ConventionSettings conventionSettings, ILoggerFactory loggerFactory, ITelegramMessageBroker telegramMessageBroker ) { _logger = loggerFactory.CreateLogger(GetType()); _userManager = userManager; _dealerService = dealerService; _eventService = eventService; _eventConferenceRoomService = eventConferenceRoomService; _regSysAlternativePinAuthenticationProvider = regSysAlternativePinAuthenticationProvider; _pushNotificationChannelRepository = pushNotificationChannelRepository; _fursuitBadgeRepository = fursuitBadgeRepository; _privateMessageService = privateMessageService; _collectingGameService = collectingGameService; _conventionSettings = conventionSettings; _telegramMessageBroker = telegramMessageBroker; _botClient = string.IsNullOrEmpty(telegramConfiguration.Proxy) ? new TelegramBotClient(telegramConfiguration.AccessToken) : new TelegramBotClient(telegramConfiguration.AccessToken, new MiniProxy(telegramConfiguration.Proxy)); _conversationManager = new ConversationManager( loggerFactory, _botClient, (chatId) => new AdminConversation( _userManager, _regSysAlternativePinAuthenticationProvider, _pushNotificationChannelRepository, _fursuitBadgeRepository, privateMessageService, _collectingGameService, _conventionSettings, loggerFactory ) ); _botClient.OnMessage += BotClientOnOnMessage; _botClient.OnCallbackQuery += BotClientOnOnCallbackQuery; _botClient.OnInlineQuery += BotClientOnOnInlineQuery; _telegramMessageBroker.OnSendMarkdownMessageToChatAsync += _telegramMessageBroker_OnSendMarkdownMessageToChatAsync; }
public AdminConversation( IUserManager userManager, IRegSysAlternativePinAuthenticationProvider regSysAlternativePinAuthenticationProvider, IEntityRepository <PushNotificationChannelRecord> pushNotificationChannelRepository, IEntityRepository <FursuitBadgeRecord> fursuitBadgeRepository, IPrivateMessageService privateMessageService, ICollectingGameService collectingGameService, ConventionSettings conventionSettings, ILoggerFactory loggerFactory ) { _logger = loggerFactory.CreateLogger(GetType()); _userManager = userManager; _regSysAlternativePinAuthenticationProvider = regSysAlternativePinAuthenticationProvider; _pushNotificationChannelRepository = pushNotificationChannelRepository; _fursuitBadgeRepository = fursuitBadgeRepository; _privateMessageService = privateMessageService; _collectingGameService = collectingGameService; _conventionSettings = conventionSettings; _commands = new List <CommandInfo>() { new CommandInfo() { Command = "/pin", Description = "Create an alternative password for an attendee to login", RequiredPermission = PermissionFlags.PinCreate, CommandHandler = CommandPinRequest }, new CommandInfo() { Command = "/pinInfo", Description = "Show the pin & issue log for a given registration number", RequiredPermission = PermissionFlags.PinQuery, CommandHandler = CommandPinInfo }, new CommandInfo() { Command = "/users", Description = "Manage Users", RequiredPermission = PermissionFlags.UserAdmin, CommandHandler = CommandUserAdmin } , new CommandInfo() { Command = "/statistics", Description = "Show some statistics", RequiredPermission = PermissionFlags.Statistics, CommandHandler = CommandStatistics }, new CommandInfo() { Command = "/locate", Description = "Figure out if a given regNo is signed in on any device", RequiredPermission = PermissionFlags.Locate, CommandHandler = CommandLocate }, new CommandInfo() { Command = "/pm", Description = "Send a personal message to a specific RegNo", RequiredPermission = PermissionFlags.SendPm, CommandHandler = CommandSendMessage }, new CommandInfo() { Command = "/badgeChecksum", Description = "Calculate the checksum letter of a given reg no.", RequiredPermission = PermissionFlags.BadgeChecksum, CommandHandler = CommandBadgeChecksum }, new CommandInfo() { Command = "/fursuitBadgeById", Description = "Lookup fursuit badge (by id)", RequiredPermission = PermissionFlags.CollectionGameAdmin, CommandHandler = CommandFursuitBadge }, new CommandInfo() { Command = "/collectionGameRegisterFursuit", Description = "Register a fursuit for the game", RequiredPermission = PermissionFlags.CollectionGameAdmin, CommandHandler = CommandCollectionGameRegisterFursuit }, new CommandInfo() { Command = "/collectionGameUnban", Description = "Unban someone from the game", RequiredPermission = PermissionFlags.CollectionGameAdmin, CommandHandler = CommandCollectionGameUnban } }; }