Beispiel #1
0
        public Startup()
        {
            _client = new PSNService();

            var database = new DatabaseService("../../../psnbot.sqlite");

            _accounts = new AccountService(database);

            var task = _client.Login("*****@*****.**", "");

            task.Wait();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.Unicode;

            var client = new PSNService();
            var task   = client.Login("*****@*****.**", "");

            task.Wait();

            if (!task.Result)
            {
                Console.WriteLine("Failed to login");
                return;
            }

            var telegramClient = new Telegram.TelegramClient("");
            var database       = new DatabaseService("../../../psnbot.sqlite");

            var accounts         = new AccountService(database);
            var timestampService = new TimeStampService(database);

            var registrationProcess = new RegistrationProcess(telegramClient, client, accounts);

            var chatId = -1001019649766;

            using (var poller = new MessagePoller(database, telegramClient, client, accounts, registrationProcess, chatId))
                using (var imagePoller = new ImagePoller(telegramClient, client, accounts, timestampService, chatId))
                    using (var trophyPoller = new TrophyPoller(telegramClient, client, accounts, timestampService, chatId))
                        using (var friendPoller = new FriendPoller(telegramClient, client, accounts, registrationProcess))
                        {
                            poller.Start();
                            imagePoller.Start();
                            //trophyPoller.Start();
                            friendPoller.Start();

                            var host = new WebHostBuilder()
                                       .UseKestrel()
                                       .UseStartup <Startup>()
                                       .Build();
                            host.Run();
                        }
        }