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

			Assert.IsTrue(client.IsUserAuthorized());

			var res = await client.ImportContactByPhoneNumber(NumberToSendMessage);

			Assert.IsNotNull(res);
			const string testFile = "TEST";

			var file = File.ReadAllBytes("../../data/cat.jpg");

			var mediaFile = await client.UploadFile("test_file.jpg", file);

			Assert.IsNotNull(mediaFile);

			var state = await client.SendMediaMessage(res.Value, mediaFile);

			Assert.IsTrue(state);
		}