private static void SubscribeOnEvents(DogeBotsHolder botsHolder) { botsHolder.OnUserCompleted += BotHolder_OnShowBotResult; botsHolder.OnSiteProcessed += BotHolder_OnSiteProcessed; botsHolder.OnSkippedUser += BotHolder_OnSkippedUser; botsHolder.OnSessionCompleted += BotHolder_OnSessionCompleted; botsHolder.OnCaptchaMeeted += BotHolder_OnCaptchaMeeted; botsHolder.OnUserStarted += BotHolder_OnUserStarted; botsHolder.OnAuthorizationNeeded += BotsHolder_OnAuthorizationNeeded; }
private static async Task Main(string[] args) { string pathToUsers = "Users.json"; List <User> users = new List <User>(); if (File.Exists(pathToUsers)) { users = JsonConvert.DeserializeObject <List <User> >(File.ReadAllText(pathToUsers)); } if (users.Count == 0) { Console.WriteLine("You have no number to work with, add new users first"); Console.ReadKey(); return; } //Adding new users, need to move it in bot holder if (args.Length > 0 && args[0].ToLower().Contains("add")) { Console.WriteLine("Adding new user"); string phone, password, ltc, apiHash; int apiId; Console.WriteLine("Enter the phone number: "); phone = Console.ReadLine(); Console.WriteLine("Enter the password for authentification: "); password = Console.ReadLine(); Console.WriteLine("Enter the API ID: "); apiId = int.Parse(Console.ReadLine()); Console.WriteLine("Enter the APIHash: "); apiHash = Console.ReadLine(); Console.WriteLine("Enter the LTC adress"); ltc = Console.ReadLine(); User userToAdd = new User(phone, password, apiId, apiHash, ltc); users.Add(userToAdd); File.WriteAllText(pathToUsers, JsonConvert.SerializeObject(users)); return; } //Running bots DogeBotsHolder botsHolder = new DogeBotsHolder(users, Input); SubscribeOnEvents(botsHolder); Console.WriteLine("Bots started"); await botsHolder.RunBots(); Console.WriteLine("Press any key..."); Console.ReadKey(); }