Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

求助:控制台-管理员无法使用,在安装词语替换后恢复,控制台无报错日志 #176

Closed
SunshineboyZj opened this issue Feb 6, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@SunshineboyZj
Copy link

内容

以下均在管理员界面中添加了我的大号QQ
这是日志界面截图
批注 2023-02-06 192500(1)
这是通过安装词语替换插件解决这个问题的视频
https://user-images.githubusercontent.com/81549837/216979333-a41a480d-b355-44a0-ac5f-07a44041db93.mp4
不知道这个问题只是我遇到了还是有其他人(笑哭)(谢谢兔妈)

@SunshineboyZj SunshineboyZj added other Not a bug, an enhancement or an advice question Further information is requested labels Feb 6, 2023
@SunshineboyZj
Copy link
Author

兔兔v6.0.12,go-cqhttp v1.0.0rc4

@Initial-heart-1
Copy link
Member

@vivien8261

@vivien8261
Copy link
Member

未能复现该问题

@vivien8261 vivien8261 added the equivocal Can't reoccurrence label Feb 15, 2023
@Initial-heart-1 Initial-heart-1 added bug Something isn't working and removed other Not a bug, an enhancement or an advice labels Feb 15, 2023
@hsyhhssyy
Copy link
Member

能看一下你的其他插件都装了什么吗?兔兔互动功能有很多插件都会参与修改,有可能是其他插件和他有冲突或者干扰。

@SunshineboyZj
Copy link
Author

SunshineboyZj commented Mar 7, 2023

能看一下你的其他插件都装了什么吗?兔兔互动功能有很多插件都会参与修改,有可能是其他插件和他有冲突或者干扰。

刚刚在没装插件的情况下试了下,还是会出现这个问题(控制台管理员添加了我,我在不是管理的群里控制不了兔兔上下班)。装了“词语替换”才好,跟上传的图片视频中情况类似。
说来也奇怪,我服务器上遇到了不少奇奇怪怪的问题(包括但不限于这件事,2016及以上系统兔兔装插件时会报SSL错误装不上),也不知道是咋回事。。。摆烂了,虽然有点小问题,但也不是不能用(

@hsyhhssyy
Copy link
Member

hsyhhssyy commented Mar 7, 2023

该异常已被定位:
amiyabot-replace的插件代码中,对is_admin进行了复写,如下所示:

@bot.handler_middleware
async def _(data: Message):
    replace: List[TextReplace] = TextReplace.select() \
        .where(TextReplace.group_id == data.guild_id, TextReplace.is_active == 1) \
        .orwhere(TextReplace.is_global == 1)

    if not data.is_admin:
        data.is_admin = bool(Admin.get_or_none(account=data.user_id))

在Core中的三个adapter都没有读取数据库(因为读不了)
Amiyabot中也没有读取这个Admin数据库

因此只有安装了词语替换才能使得后台中的管理员账户生效。

建议将该插件的midware移动到amiyabot项目中。

@vivien8261
Copy link
Member

该异常已被定位: amiyabot-replace的插件代码中,对is_admin进行了复写,如下所示:

@bot.handler_middleware
async def _(data: Message):
    replace: List[TextReplace] = TextReplace.select() \
        .where(TextReplace.group_id == data.guild_id, TextReplace.is_active == 1) \
        .orwhere(TextReplace.is_global == 1)

    if not data.is_admin:
        data.is_admin = bool(Admin.get_or_none(account=data.user_id))

在Core中的三个adapter都没有读取数据库(因为读不了) Amiyabot中也没有读取这个Admin数据库

因此只有安装了词语替换才能使得后台中的管理员账户生效。

建议将该插件的midware移动到amiyabot项目中。

确实……核心库的消息生命周期改名之后修复这个问题

@Initial-heart-1 Initial-heart-1 removed the equivocal Can't reoccurrence label Mar 12, 2023
@Initial-heart-1 Initial-heart-1 removed the question Further information is requested label May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants