示例#1
0
        static async Task Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .MinimumLevel.Debug()
                         .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
                         .MinimumLevel.Override("System", LogEventLevel.Error)
                         .Enrich.FromLogContext()
                         .Enrich.WithProperty("ServiceName", "pt-applications")
                         .WriteTo.Console()
                         .WriteTo.RollingFile(Path.Combine(Environment.CurrentDirectory, "/Logs/Errors"), LogEventLevel.Error)
                         .CreateLogger();

            var config = StartupConfig("appsettings.json");

            var core = new Core(config);

            IrcClientSingelton.Generate(config.Login, config.OAuth, config.IrcHost, config.Port);

            var client = IrcClientSingelton.Instance;
            await client.Authorize();

            await client.JoinRoom("dudelka_krasnaya");

            await client.Privmsg("dudelka_krasnaya", "I'm not PlotoiadnuiKeksik Kappa I'm a bot of Dudelka ", "Dudelka_Krasnaya");

            await Task.Delay(2000);

            await client.Privmsg("dudelka_krasnaya", "Test broadcast message");

            while (true)
            {
                var message = await client.ReadMessage();
            }
        }
示例#2
0
 public IrcClientTest()
 {
     //TODO: Do mock class for emulation Twitch IRC Server
     IrcClientSingelton.Generate(AuthOptions);
     IrcClient = IrcClientSingelton.Instance;
 }