コード例 #1
0
        public async Task StartAsync()
        {
            var fileLoggerOptions = new FileLoggerOptions();

            _config.Bind("filelogger", fileLoggerOptions);
            _loggerFactory.AddProvider(new DogeyLoggerProvider(fileLoggerOptions));

            await _discord.LoginAsync(TokenType.Bot, _config["tokens:discord"]);

            await _discord.StartAsync();

            var guildReader = new GuildTypeReader();

            _commands.AddTypeReader <IGuild>(guildReader);
            _commands.AddTypeReader <RestGuild>(guildReader);
            _commands.AddTypeReader <SocketGuild>(guildReader);
            _commands.AddTypeReader <Uri>(new UriTypeReader());
            _commands.AddTypeReader <Emote>(new EmoteTypeReader());
            _commands.AddTypeReader <IEmote>(new EmoteTypeReader());
            _commands.AddTypeReader <Emoji>(new EmoteTypeReader());
            _commands.AddTypeReader <ModuleInfo>(new ModuleInfoTypeReader());

            await _commands.AddModulesAsync(Assembly.GetEntryAssembly(), _provider);
        }
コード例 #2
0
 public DogeyLoggerProvider(FileLoggerOptions options)
 {
     _options = options;
 }