【问题标题】:Reporting spam or abuse via Telethon通过 Telethon 报告垃圾邮件或滥用行为
【发布时间】:2019-12-11 02:57:31
【问题描述】:

我在 python 中使用 Telethon 来自动回复 Telegram 组。我想通过 Telethon 自动报告垃圾邮件或滥用帐户,我阅读了 Telethon 文档并用谷歌搜索,但我找不到任何示例。 如果可以的话,请提供一个带有示例代码的示例。

【问题讨论】:

  • 我快速扫描了电报API,找不到任何发送报告的公共方法,大概是因为这是可滥用的。尝试观察以查看发送报告时联系的端点。
  • @JammyDodger 这些方法适用于任何 MTProto 客户端,请参阅 tl.telethon.dev?q=report&redirect=no
  • @Lonami 啊,这与我看到的不同。

标签: python telegram telegram-bot telethon


【解决方案1】:

https://tl.telethon.dev/methods/messages/report.html

页面示例:

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.messages.ReportRequest(
        peer='username',
        id=[42],
        reason=types.InputReportReasonSpam()
    ))
    print(result)

【讨论】:

    【解决方案2】:

    一个can use search找到以下举报方法:

    【讨论】:

      猜你喜欢
      • 2011-06-15
      • 1970-01-01
      • 1970-01-01
      • 2018-07-12
      • 2019-07-22
      • 2011-03-07
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      相关资源
      最近更新 更多