TeamPGM / PagerMaid-Pyro

Advanced Multi-Featured Telegram UserBot by pyrogram.
GNU Affero General Public License v3.0
646 stars 81 forks source link

[Bug]: 其他用户使用部分指令无法正确回复 #24

Closed BLxcwg666 closed 2 years ago

BLxcwg666 commented 2 years ago

请确保您已阅读以上注意事项,并勾选下方的确认框。

PagerMaid 版本 (或 Commit Id)

2.0.40

运行环境

其它(请在下方说明)

运行架构

x86

重现步骤

如题,我使用以下命令 sudo add sudo on 给予了其他用户使用 Pagermaid-Pyro 的权限 然而对方在使用一些指令的时候 比如/ip/wiki等指令 Pagermaid-Pyro 回应了但是没有回应正确的内容 而是卡在 正在查询中.....获取中......

Screenshot_2022-08-23-20-54-22-423_com blxueya gugugram

Screenshot_2022-08-23-20-53-49-133_com blxueya gugugram

并且每发送一条类似的指令我的帐号就会向 @PagerMaid_Modify_bot 上报错误日志

Screenshot_2022-08-23-20-48-17-031_com blxueya gugugram

期望的结果是什么?

能用,能跑,能运行

实际的结果是什么?

跑不了

简单的复现代码/链接(可选)

我:
,sudo on
,sudo add

对面:
/ip 114.51.41.91
/wiki Nvidia

日志记录(可选)

/ip 的日志内容:
`# Generated: 12:46 23/08/2022. 
# ChatID: 1145141919. 
# UserID: 1145141919. 
# Message: 
-----BEGIN TARGET MESSAGE-----
/ip 39.156.66.10
-----END TARGET MESSAGE-----
# Traceback: 
-----BEGIN TRACEBACK-----
Traceback (most recent call last):
  File "/pgp/plugins/ip.py", line 54, in ipinfo
    await message.edit(await get_ip_info(url))
  File "/pgp/pyromod/listen/listen.py", line 250, in edit_text
    from_id = self.from_user.id if self.from_user else self.sender_chat.id
AttributeError: 'NoneType' object has no attribute 'id'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pgp/pagermaid/listener.py", line 145, in handler
    await function(**data)
  File "/pgp/plugins/ip.py", line 58, in ipinfo
    await message.edit('没有找到要查询的 ip/域名 ...')
  File "/pgp/pyromod/listen/listen.py", line 250, in edit_text
    from_id = self.from_user.id if self.from_user else self.sender_chat.id
AttributeError: 'NoneType' object has no attribute 'id'

-----END TRACEBACK-----
# Error: "'NoneType' object has no attribute 'id'".`

/wiki 的日志内容:
`# Generated: 12:53 23/08/2022. 
# ChatID: 1145141919. 
# UserID: 1145141919. 
# Message: 
-----BEGIN TARGET MESSAGE-----
/wiki Nvidia
-----END TARGET MESSAGE-----
# Traceback: 
-----BEGIN TRACEBACK-----
Traceback (most recent call last):
  File "/pgp/pagermaid/listener.py", line 145, in handler
    await function(**data)
  File "/pgp/plugins/xtao-some.py", line 72, in wiki
    await message.edit(text)
  File "/pgp/pyromod/listen/listen.py", line 250, in edit_text
    from_id = self.from_user.id if self.from_user else self.sender_chat.id
AttributeError: 'NoneType' object has no attribute 'id'

-----END TRACEBACK-----
# Error: "'NoneType' object has no attribute 'id'".`

补充说明(可选)

测试过的环境: Ubuntu 20.04 x86_64 + Python 3.9.0 Ubuntu 22.04 AMD64 + Python 3.10.0 Debian 11 x86_64 + Python 3.9.0