使用 python-telegram-bot 或 Telethon 在 Telegram 中输入联系人

问题描述

from telegram import Update
from telegram.ext import Updater,CommandHandler,CallbackContext
import telebot
from telethon import TelegramClient,client
from telethon.tl.functions.contacts import GetContactsRequest,Import ContactsRequest
from telethon.tl.types import InputPeerUser,InputPhoneContact

contact = InputPhoneContact(client_id = 0,phone = "+12345678",first_name="ABC",last_name="abc")
result = client.invoke(ImportContactsRequest([contact],replace=True))
print(f"1: {contact}\n2: {result}")

我无法根据编写程序解释这个错误的原因 指令,但它不回答

错误是:

    `AttributeError: module 'telethon.client' has no attribute 'invoke`


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)