Skip to content

Commit

Permalink
允许匿名消息触发脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
super1207 committed Aug 7, 2023
1 parent 8038381 commit bdcd3a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cqevent/do_group_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ fn do_redlang(root: &serde_json::Value) -> Result< (), Box<dyn std::error::Error
{
let sender = root.get("sender").ok_or("sender not exists")?;
{
let role_js = sender.get("role").ok_or("role in sender not exists")?;
let role = role_js.as_str().ok_or("role in sender not str")?;
let role_str = match role {
let role = read_json_str(sender, "role");
let role_str = match role.as_str() {
"owner" => "群主",
"admin" => "管理",
&_ => "群员"
Expand Down

0 comments on commit bdcd3a2

Please sign in to comment.