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

fix:删除非OneBot 12 标准字段 #108

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/OneBot/V12/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public static function validateHttpUrl(string $url): void
public static function validateEventParams(array $data)
{
// 每个 OneBot 事件必须有这几个参数
if (!isset($data['type'], $data['id'], $data['detail_type'], $data['time'], $data['sub_type'])) {
throw new OneBotException('onebot 12 requires type, id, detail_type, time, sub_type');
if (!isset($data['type'], $data['id'], $data['detail_type'], $data['sub_type'])) {
throw new OneBotException('onebot 12 requires type, id, detail_type, sub_type');
}
// 除元事件(type = meta)外,其他事件必须拥有 self 字段
if ($data['type'] !== 'meta' && !isset($data['self'])) {
Expand Down
Loading