public FriendPoller(TelegramClient telegramClient, PSNService psnService, AccountService accounts, RegistrationProcess registrationProcess) { _telegramClient = telegramClient; _psnService = psnService; _accounts = accounts; _registrationProcess = registrationProcess; }
public ListCommand(PSNService psnService, TelegramClient telegramClient, AccountService accounts) { _psnService = psnService; _telegramClient = telegramClient; _accounts = accounts; _regex = new Regex("^/list", RegexOptions.IgnoreCase); }
public SearchCommand(PSNService psnService, TelegramClient telegramClient, AccountService accounts) { _psnService = psnService; _telegramClient = telegramClient; _accounts = accounts; _regex = new Regex("^/search(\\s+(?<param>.+))?", RegexOptions.IgnoreCase); }
public StartCommand(PSNService psnService, TelegramClient telegramClient, AccountService accounts, RegistrationProcess registrationProcess) { _psnService = psnService; _telegramClient = telegramClient; _accounts = accounts; _registrationProcess = registrationProcess; _regex = new Regex("^/start", RegexOptions.IgnoreCase); }
public ImagePoller(TelegramClient telegramClient, PSNService psnService, AccountService accounts, TimeStampService timestampService, long chatId) { _chatId = chatId; _telegramClient = telegramClient; _psnService = psnService; _accounts = accounts; _timestampService = timestampService; }
public DeleteCommand(PSNService psnService, TelegramClient telegramClient, AccountService accounts, RegistrationProcess process) { _psnService = psnService; _telegramClient = telegramClient; _accounts = accounts; _regex = new Regex("^/delete", RegexOptions.IgnoreCase); _process = process; }
public Startup() { _client = new PSNService(); var database = new DatabaseService("../../../psnbot.sqlite"); _accounts = new AccountService(database); var task = _client.Login("*****@*****.**", ""); task.Wait(); }
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(); } }
public MessagePoller(DatabaseService databaseService, TelegramClient client, PSNService psnService, AccountService accounts, RegistrationProcess registrationProcess, long chatId) { _chatId = chatId; _client = client; _psnService = psnService; _accounts = accounts; _databaseService = databaseService; _registrationProcess = registrationProcess; _commands = new Command[] { new TopCommand(_psnService, client, _accounts), new SearchCommand(_psnService, client, _accounts), new ListCommand(_psnService, client, _accounts), new StartCommand(_psnService, client, _accounts, _registrationProcess), new HelpCommand(_psnService, client, _accounts), new RulesCommand(_psnService, client, _accounts), new OnlineCommand(_psnService, client, _accounts), new DeleteCommand(_psnService, client, _accounts, _registrationProcess), new SetInterestsCommand(_psnService, client, _accounts, _registrationProcess), new SetTrophiesCommand(_psnService, client, _accounts, _registrationProcess), }; }
public RegistrationProcess(TelegramClient telegramClient, PSNService psnService, AccountService accountService) { _telegramClient = telegramClient; _psnService = psnService; _accountService = accountService; }