简体   繁体   English

您如何回复来自“回复”聊天 (Teleton) 的消息?

[英]How do you reply to a message from "Replies" chat (Telethon)?

Problem问题

My "userbot" leaves comments on new posts from channels我的“用户机器人”对频道的新帖子发表评论

Some users reply to my comments, those replies appear in my "Replies" dialog一些用户回复我的评论,这些回复出现在我的“回复”对话框中

I want to reply back to those replies, but I get same error我想回复这些回复,但我得到同样的错误

telethon.errors.rpcerrorlist.YouBlockedUserError: You blocked this user (caused by SendMessageRequest)

I don't have any users in the black list我在黑名单中没有任何用户

Code代码

This my message handler这是我的消息处理程序

# id of "Replies" dialog 
replies_chat_id = 1271266957

async def handle_message(event: events.NewMessage.Event):
    # handle msg from "replies" chat (problem is here)
    if (event.chat_id == replies_chat_id):
        # just send 'ok' to everyone who replied to my comment
        await event.client.send_message(message="ok", entity=event.chat_id, reply_to=event.message)
    # handle msg from channel (it works fine)
    elif (event._broadcast):
        # just leave a comment on post
        await event.client.send_message(message="ok", entity=event.chat_id, comment_to=event.message)

After reading about Threads I've managed to solve the problem在阅读了有关Threads的信息后,我设法解决了这个问题

await event.client.send_message(
  entity = event.message.reply_to.reply_to_peer_id, 
  reply_to = event.message.fwd_from.saved_from_msg_id, 
  message = 'ok'
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM