Ejemplo n.º 1
0
        public static async Task StartServiceHandlers(IServiceProvider provider)
        {
            _logger = provider.GetService <LogChannelService>();
            _config = provider.GetService <Config>();
            _mongo  = provider.GetService <MongoClient>();

            Logger.Info("Installing CommandHandler");
            await CommandHandler.Install(provider);

            await CommandHandler.ConfigureAsync();

            Logger.Info("Installing FAQ Service");
            await FaqService.Install(provider);

            await FaqService.LoadFaqs();

            Logger.Info("Installing AntiAds Service");
            await AntiAds.AntiAds.Install(provider);

            await AntiAds.AntiAds.StartAsync();

            Logger.Info("Installing Violations Service");
            await Violations.Violations.Install(provider);

            Logger.Info("Loading JobQueue");
            await JobQueue.Install(provider);

            _client.JoinedGuild += JoinedGuild;
            _client.LeftGuild   += LeftGuild;
        }
Ejemplo n.º 2
0
 public FaqController(FaqRepository faqRepository, FaqService faqService, IMapper mapper, PaginatedMetaService paginatedMetaService)
 {
     _faqRepository        = faqRepository;
     _faqService           = faqService;
     _mapper               = mapper;
     _paginatedMetaService = paginatedMetaService;
 }
Ejemplo n.º 3
0
        public static async System.Threading.Tasks.Task <string> MessageHandler(string inputStr)
        {
            string response = String.Empty;

            // Convert input string to FaqLuis Model
            LuisObject faqLuis = await LuisService.ParseFaqInput(inputStr);

            if (faqLuis.topScoringIntent != null)
            {
                switch (faqLuis.topScoringIntent.intent)
                {
                case "FaqQuery":
                    response = await FaqService.FaqQueryProcessor(faqLuis.topScoringIntent);

                    break;

                case "Assistance":
                    response = ResponseSet.GetRandomResponse(ResponseSet.Assistance);
                    break;

                case "DirectAddress":

                    response = await DirectAddressHandler(inputStr);

                    break;

                case "Farewell":
                    response = ResponseSet.GetRandomResponse(ResponseSet.Farewells);
                    break;

                case "Politeness":
                    response = ResponseSet.GetRandomResponse(ResponseSet.Emojis);
                    break;

                //- Could not place request
                default:
                    response = ResponseSet.GetRandomResponse(ResponseSet.Nones);
                    break;
                }
            }
            return(response);
        }
Ejemplo n.º 4
0
 public FaqController(IFaqRepository repository, FaqService service)
 {
     this.repository = repository;
     this.service    = service;
 }