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

在 MessageSource.recall 时预先检查权限 #1175

Closed
Nambers opened this issue Apr 7, 2021 · 0 comments · Fixed by #1662
Closed

在 MessageSource.recall 时预先检查权限 #1175

Nambers opened this issue Apr 7, 2021 · 0 comments · Fixed by #1662
Labels
N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题
Milestone

Comments

@Nambers
Copy link
Contributor

Nambers commented Apr 7, 2021

当bot在执行recall的时候并且权限不足的时候,会报错

Recv: Failed(result=1001, errorMessage=No message meets the requirements)

并抛出IllegalStateException而不是PermissionDeniedException
相关日志:

2021-04-08 07:53:25 V/Bot 692928873: [JM、Eritque ar...(788*****)] Eritque arcus(193*******) -> c
2021-04-08 07:53:25 V/Net 692928873: Send: PbMessageSvc.PbMsgWithDraw
2021-04-08 07:53:25 V/Net 692928873: Recv: Failed(result=1001, errorMessage=No message meets the requirements)
2021-04-08 07:53:25 E/Bot 692928873: 该消息已被撤回
2021-04-08 07:53:28 V/Bot 692928873: [JM、Eritque ar...(788*****)] Eritque arcus(193*******) -> a
2021-04-08 07:53:28 V/Net 692928873: Send: PbMessageSvc.PbMsgWithDraw
2021-04-08 07:53:28 V/Net 692928873: Recv: Failed(result=1001, errorMessage=No message meets the requirements)
2021-04-08 07:53:28 E/Bot 692928873: 该消息已被撤回

版本

  • mirai-core: 2.5.0

补充信息

确认是管理员?

如果不是管理员,也就是说无权限撤回应该是进入try里面的PermissionDeniedException吧?

Originally posted by @Nambers in #1065 (reply in thread)

@Nambers Nambers added the x:question 标签: 需要更多信息 label Apr 7, 2021
@Him188 Him188 added N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题 and removed x:question 标签: 需要更多信息 labels Apr 8, 2021
@Him188 Him188 added this to the Backlog milestone Apr 8, 2021
@Him188 Him188 changed the title Recall 权限处理 在 MessageSource.recall 时预先检查权限 Apr 8, 2021
@Him188 Him188 modified the milestones: Backlog, 2.9.0-M1 Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N 优先级: 一般 t:problem 类型: 不容易归类为特性或 bug 的综合问题
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants