Пример #1
0
        public async Task InitializeAsync()
        {
            socketClient.MessageReceived += HandleMessageReceivedAsync;

            await logger.Log(
                new Discord.LogMessage(
                    Discord.LogSeverity.Info,
                    "Gpt2MessagingService",
                    "Ready!"));
        }
Пример #2
0
        public async Task InitializeAsync()
        {
            await commandService.AddModuleAsync <GuildConfigurationModule>(services);

            await commandService.AddModuleAsync <GPT2ChatConfigModule>(services);

            await logger.Log(new LogMessage(
                                 LogSeverity.Info,
                                 "CommadHandler",
                                 $"Available commands: {string.Join(", ", commandService.Commands.Select((commandInfo) => commandInfo.Name))}"
                                 ));


            client.MessageReceived += HandleCommandAsync;
        }
Пример #3
0
        public ServerConfigService(IServiceProvider serviceProvider, DiscordSocketClient socketClient, LoggerService logger)
        {
            this.serviceProvider = serviceProvider;
            this.socketClient    = socketClient;
            this.logger          = logger;

            logger.Log(new LogMessage(LogSeverity.Info, "ServerConfigService", "Service up and running!"));

            serverConfigDictionary = new Dictionary <ulong, ServerConfig>();

            socketClient.GuildAvailable += OnGuildAvailable;
            socketClient.JoinedGuild    += OnGuildJoined;
        }