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

修复 FullMatchRule 中调用 ctx.NickName() 的 panic 问题 #902

Merged
merged 1 commit into from
May 10, 2024

Conversation

Kittengarten
Copy link
Contributor

@Kittengarten Kittengarten commented May 9, 2024

image

PrefixRulectx.State 具有 "args" 键,而 FullMatchRule 并不具有,879948a 之后,ctx.NickName() 调用 ctx.State["args"] 时访问了不存在的键,引发 panic

鉴于 name 变量仅用于输出用户的昵称,无需从 args/at 获取昵称,因此使用能够满足需求的 ctx.CardOrNickName(ctx.Event.UserID) 来获取用户群昵称或昵称。

@fumiama fumiama merged commit a9dfbdb into FloatTech:master May 10, 2024
8 checks passed
YumeMichi added a commit to YumeMichi/ZeroBot-Plugin that referenced this pull request May 15, 2024
* https://github.com/FloatTech/ZeroBot-Plugin:
  feat: add plugin 抽扑克牌 (FloatTech#906)
  fix(workflow): pr not work properly
  Revert "feat: add plugin 抽扑克! (FloatTech#903)" (FloatTech#905)
  feat: add plugin 抽扑克! (FloatTech#903)
  [dish] fix: 关键词搜寻功能 (FloatTech#904)
  修复 FullMatchRule 中调用 ctx.NickName() 的 panic 问题 (FloatTech#902)
  optimize: gif plugin for image cache (FloatTech#901) (fix FloatTech#900)
  Update guessmusic plugin (FloatTech#898)
  make lint happy
  add robbery plugin (FloatTech#893)
  [mcfish]  Add one click selling (FloatTech#894)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants