我有一个脚本可以检测每次我用皮影戏制作剪辑时的情况。我想让它把特定主题的视频发送到我的电报群。
我能够得到的关闭是使用此代码发送到“常规”主题
from telethon.sync import TelegramClient
api_id = ''
api_hash = ''
group_id = ''
topic_name = ''
with TelegramClient('anon', api_id, api_hash) as client:
client.send_file(group_id, 'test.jpg')
但我想这样做,以便将文件发送到确定的主题。在他们的变更日志(v1.26)中,他们似乎现在应该接受主题。
一定有这样的参数
to_peer=dest_id, top_msg_id=dest_topic_id
其中 top_msg_id 是主题 id,如果您复制主题内消息的链接即可获取它,它看起来像“https://t.me/chanel_id/topic_id/message_id”
id 必须写为整数,而不是字符串