提问人:Микита Шапко 提问时间:11/18/2023 更新时间:11/18/2023 访问量:11
telethon JoinChatlistInviteRequest exeption “过滤器的include_peers向量为空”
telethon JoinChatlistInviteRequest exeption "The include_peers vector of the filter is empty"
问:
我的代码是:
from telethon.sync import TelegramClient
from telethon import functions, types
api_id = '****'
api_hash = '****'
phone_number = '+****'
with TelegramClient(phone_number, api_id, api_hash) as client:
try:
user = client.get_entity('@****')
# Use types module for InputPeerUser
user1 = types.InputPeerUser(user_id=user.id, access_hash=user.access_hash)
print(user1)
# Ensure that peers is a non-empty list
result = client(functions.chatlists.JoinChatlistInviteRequest(
slug='https://t.me/addlist/****',
peers=[user1] # Make sure the list is not empty
))
print(result.stringify())
except Exception as e:
print(f"Error: {e}")
我的输出是:
InputPeerUser(user_id=****, access_hash=-****)
Error: The include_peers vector of the filter is empty (caused by JoinChatlistInviteRequest)
Process finished with exit code 0
所以 userPeer 不为空,它存在,如果 smth 初始化错误,我会得到类型上的执行。InputPeerUser() 步骤,我错了吗? 那么,如果peer存在,我如何得到“过滤器的include_peers向量是空的”?
我希望它能起作用(
答: 暂无答案
评论