Ejemplo n.º 1
0
        public CommandHandler(DiscordSocketClient client, ServiceDependencyMap dependencyMap)
        {
            _client        = client;
            _dependencyMap = dependencyMap;

            _commandService = new CommandService(new CommandServiceConfig()
            {
                DefaultRunMode        = RunMode.Sync,
                CaseSensitiveCommands = false
            });

            _commandService.AddTypeReader <DateTime>(new DateTypeReader());
            _commandService.AddTypeReader <Segment>(new SegmentTypeReader(_dependencyMap));
            _commandService.AddTypeReader <Profile>(new ProfileTypeReader(_dependencyMap));

            HelpService.RegisterCommandService(_commandService);

            ExtendedModuleBase.SetDependencyMap(dependencyMap);

            _client.MessageReceived += handler;
        }
Ejemplo n.º 2
0
 public HelpCommand()
 {
     _helpService = DepMap.GetService <HelpService>();
     _client      = DepMap.Get <DiscordSocketClient>();
 }