Skip to content

Commit

Permalink
build: 1.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed May 18, 2024
1 parent 461feca commit 91fc836
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/onebot11/action/msg/SendMsg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ async function createContext(payload: OB11PostSendMsg): Promise<{
// not message_type.
// This redundant design of Ob11 here should be blamed.

if (payload.user_id) { // take this as a private message
if (payload.group_id) { // take this as a group message
const group = (await getGroup(payload.group_id))!; // checked before
return {
peer: {
chatType: ChatType.group,
peerUid: group.groupCode
},
group: group,
};
} else if (payload.user_id) { // take this as a private message
const friend = await getFriend(payload.user_id.toString());
if (!friend) {
if (ALLOW_SEND_TEMP_MSG) {
Expand All @@ -101,15 +110,6 @@ async function createContext(payload: OB11PostSendMsg): Promise<{
peerUid: friend.uid
},
};
} else if (payload.group_id) { // take this as a group message
const group = (await getGroup(payload.group_id))!; // checked before
return {
peer: {
chatType: ChatType.group,
peerUid: group.groupCode
},
group: group,
};
}
throw '请指定 group_id 或 user_id';
}
Expand Down

0 comments on commit 91fc836

Please sign in to comment.