在电报讨论中的一些评论是从渠道发送的(点击名称和访问频道页面)。此消息具有sender_chat属性。如何将评论作为渠道发布?(手动或通过热图)。如果评论在我的频道,我可以选择发件人,但其他聊天没有发送者交换机btn。抱歉,我的英语不好
发布于 2022-10-10 17:11:29
在调用set_send_as_chat()之前指定send_message(),如下所示(Pyrogram 2.0+):
from pyrogram import Client
Credentials = Client(
name="ad_comment_on_channel",
api_id=---,
api_hash="---",
device_model="Ad Comment On Channel",
app_version="ACoCh v1.0",
)
with Credentials as app:
# Discussion Group's Numeric ID (starting with -100) [integer]
group_ID = -1001234567890
# ID of a post in the discussion group [integer]
msg_ID = 123
# Select your public channel for anonymous commenting
app.set_send_as_chat(group_ID, "YourPublicChannelUserName")
app.send_message(
chat_id=group_ID,
reply_to_message_id=msg_ID,
text="My Comment"
)发布于 2022-10-12 10:26:15
谢谢阿里·阿卜迪的帮助!附加细节-您必须是通道所有者才能将消息作为通道发布(管理员不能这样做)
https://stackoverflow.com/questions/72251887
复制相似问题