我是python新手,我想使用Telethon使用google云函数,但我不能这样做,因为我在运行时出错
以下是Gcloud功能代码我的代码:
from telethon import TelegramClient, events, sync
#from telethon import functions, types
#from telethon.tl.functions.channels import CreateChannelRequest, CheckUsernameRequest, UpdateUsernameRequest, InviteToChannelRequest
#from telethon.tl.types import InputChannel, InputPeerChannel
api_id = XXX
api_hash = 'XXX'
def hello_world(request):
with TelegramClient("session_name", api_id, api_hash) as client:
from telethon.tl.functions.channels import CreateChannelRequest, CheckUsernameRequest, UpdateUsernameRequest
from telethon.tl.types import InputChannel, InputPeerChannel
from telethon.tl.types import InputPhoneContact
from telethon.tl.types import InputPeerUser
from telethon.tl.functions.contacts import ImportContactsRequest
contact = InputPhoneContact(client_id=11111, phone='1111111111', first_name="Twilo Test",last_name="Phone")
newcontact = client(ImportContactsRequest(contacts=[contact]))
return newcontact.__dict__;
My Requerements.txt:
# Function dependencies, for example:
# package>=version
telethon
当我运行函数(hello_world)时,我得到以下错误:
目前没有回答
相关问题 更多 >
编程相关推荐