【问题标题】:How to find 'user_hash' on telegram?如何在电报上找到“user_hash”?
【发布时间】:2021-06-26 14:59:39
【问题描述】:

我正在尝试使用 telethon 和 telebot 从我在 python 中的代码发送通知。 我已经配置了一切,但代码问我以下问题:

receiver = InputPeerUser('user_id', 'user_hash')

我资助了 user_id,但我不知道在哪里可以获取我的 user_hash。

【问题讨论】:

标签: python telegram telegram-bot telethon


【解决方案1】:

如果您没有“user_hash”,只需输入 0。

即:

userid=555555555
userhash=0

receiver=InputPeerUser(userid, userhash)

对于那些带有“限制”参数的请求,您通常可以将其设置为 零表示“返回默认金额”。这不适用于所有人 但是,例如,在“messages.search”中,它实际上会 返回 0 项。

参考: https://telethonn.readthedocs.io/en/latest/extra/advanced-usage/accessing-the-full-api.html

【讨论】:

    【解决方案2】:

    您必须与该用户进行公开对话。或者你收到了他的消息。加载完所有对话框后,该用户的信息就会随之而来。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-06
      • 2018-01-30
      • 2022-10-14
      • 2018-03-05
      • 2017-09-03
      • 1970-01-01
      相关资源
      最近更新 更多