Exemplo n.º 1
0
        public async Task CheckPhones()
        {
            var store  = new FileSessionStore();
            var client = new Core.TelegramClient(store, "session");
            await client.Connect();

            var phoneList = new string[]
            {
                RegisteredNumber,
                NumberToAuthenticate
            };

            var rand = new Random();

            foreach (var phone in phoneList)
            {
                var result = await client.IsPhoneRegistered(phone);

                Thread.Sleep(rand.Next(9) * 1000);
                if (result)
                {
                    Console.WriteLine($"{phone} - OK");
                }
            }
        }
Exemplo n.º 2
0
        public async Task TestConnection()
        {
            var store  = new FakeSessionStore();
            var client = new Core.TelegramClient(store, "");

            Assert.IsTrue(await client.Connect());
        }
		public async Task CheckPhones()
		{
			var store = new FileSessionStore();
			var client = new Core.TelegramClient(store, "session");
			await client.Connect();

			var result = await client.IsPhoneRegistered(NumberToAuthenticate);
			Assert.IsTrue(result);
		}
Exemplo n.º 4
0
        private async void conn()
        {
            TLSharp.Core.TelegramClient client = new Core.TelegramClient(fnc.apiId, fnc.apiHash);

            await client.ConnectAsync();

            Auth(client, "+821072919103");

            SendMessageByPhoneNumber(client, "821026799103", "20161109");
        }
Exemplo n.º 5
0
        public async Task ImportContact()
        {
            // User should be already authenticated!

            var store  = new FileSessionStore();
            var client = new Core.TelegramClient(store, "session");

            await client.Connect();

            Assert.IsTrue(client.IsUserAuthorized());

            var res = await client.ImportContact(RegisteredNumber);

            Assert.IsNotNull(res);
        }
Exemplo n.º 6
0
		public async Task TestConnection()
		{
			var store = new FakeSessionStore();
			var client = new Core.TelegramClient(store, "");

			Assert.IsTrue(await client.Connect());
		}
Exemplo n.º 7
-1
		public async Task ImportContact()
		{
			// User should be already authenticated!

			var store = new FileSessionStore();
			var client = new Core.TelegramClient(store, "session");
			await client.Connect();

			Assert.IsTrue(client.IsUserAuthorized());

			var res = await client.ImportContact(RegisteredNumber);

			Assert.IsNotNull(res);

		}
Exemplo n.º 8
-1
		public async Task CheckPhones()
		{
			var store = new FileSessionStore();
			var client = new Core.TelegramClient(store, "session");
			await client.Connect();

			var phoneList = new string[]
			{
				RegisteredNumber,
				NumberToAuthenticate
			};

			var rand = new Random();
			foreach (var phone in phoneList)
			{
				var result = await client.IsPhoneRegistered(phone);
				Thread.Sleep(rand.Next(9) * 1000);
				if (result)
					Console.WriteLine($"{phone} - OK");
			}
		}