2016-10-21 4 views
1

私は連絡先をtelegram-cliにvcardを使用して追加しようとしています。しかし、私はこのコマンドを使用する:vcardを使用してテレグラムに連絡先を追加する方法は?

import_card <card> 

何も起こらない!エラーがなく、連絡先が追加されずに次の行に移動します。

私のvCardのバージョンである:2.1

どのように私は、vCardのを使用して、私の電報口座に私の連絡先をimprotことができますか?

答えて

1

インストール・パッケージ

client = new TelegramClient(apiId, apiHash); 
    await client.ConnectAsync(); 
    var phoneContact = new TLInputPhoneContact() { phone = "", first_name = "", last_name = "" }; 
    var contacts = new List<TLInputPhoneContact>() { phoneContact }; 
    var req = new TeleSharp.TL.Contacts.TLRequestImportContacts() { contacts = new TLVector<TLInputPhoneContact>() { lists = contacts } }; 
    var rrr=  await client.SendRequestAsync<TeleSharp.TL.Contacts.TLImportedContacts>(req); 
0
private async Task<bool> ImportContact(string _phone , string _first_name , string _last_name) 
     { 
      //https://github.com/sochix/TLSharp/issues/243 
      var phoneContact = new TLInputPhoneContact() { phone = _phone, first_name = _first_name, last_name = _last_name }; 
      var contacts = new List<TLInputPhoneContact>() { phoneContact }; 
      var req = new TLRequestImportContacts() { contacts = new TLVector<TLInputPhoneContact>() { lists = contacts } }; 
      TLImportedContacts result = await client.SendRequestAsync<TLImportedContacts>(req); 
      if (result.users.lists.Count > 0) 
       return true; 
      else return false; 
     } 
TLSharp
関連する問題