首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >电报评论帖为渠道

电报评论帖为渠道
EN

Stack Overflow用户
提问于 2022-05-15 20:17:16
回答 2查看 257关注 0票数 0

在电报讨论中的一些评论是从渠道发送的(点击名称和访问频道页面)。此消息具有sender_chat属性。如何将评论作为渠道发布?(手动或通过热图)。如果评论在我的频道,我可以选择发件人,但其他聊天没有发送者交换机btn。抱歉,我的英语不好

EN

回答 2

Stack Overflow用户

发布于 2022-10-10 17:11:29

在调用set_send_as_chat()之前指定send_message(),如下所示(Pyrogram 2.0+):

代码语言:javascript
复制
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"
    )
票数 1
EN

Stack Overflow用户

发布于 2022-10-12 10:26:15

谢谢阿里·阿卜迪的帮助!附加细节-您必须是通道所有者才能将消息作为通道发布(管理员不能这样做)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72251887

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档