Skip to content

Commit

Permalink
修复取出消息时LocalImageElement缺失问题 (#1884)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctaoist authored Feb 3, 2023
1 parent fc0845b commit d96f840
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions coolq/cqcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@ func toElements(e []message.IMessageElement, source message.Source) (r []cqcode.
{K: "type", V: "sticker"},
},
}
case *LocalImageElement:
data := pairs{
{K: "file", V: o.File},
{K: "url", V: o.URL},
}
if o.Flash {
data = append(data, pair{K: "type", V: "flash"})
}
m = cqcode.Element{
Type: "image",
Data: data,
}
default:
continue
}
Expand Down

0 comments on commit d96f840

Please sign in to comment.