mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-22 07:07:53 +00:00
fix(api): fix common send
This commit is contained in:
parent
c3d3974643
commit
5467e7bfd9
@ -10,7 +10,10 @@ export const commonSend = async (
|
||||
peer: Partial<Peer>,
|
||||
elements: O.Partial<Element, 'deep'>[],
|
||||
) => {
|
||||
const privatePeerUid = await ctx.chronocat.uix.getUid2(peer.peerUid!)
|
||||
let privatePeerUid: string | undefined = undefined
|
||||
|
||||
if (peer.chatType === ChatType.Private) {
|
||||
privatePeerUid = await ctx.chronocat.uix.getUid2(peer.peerUid!)
|
||||
if (!privatePeerUid) {
|
||||
ctx.chronocat.l.error('内部错误', {
|
||||
code: 2152,
|
||||
@ -18,6 +21,7 @@ export const commonSend = async (
|
||||
})
|
||||
return Promise.resolve<RedMessage>(undefined as unknown as RedMessage)
|
||||
}
|
||||
}
|
||||
|
||||
const param = {
|
||||
msgId: '0',
|
||||
@ -26,7 +30,7 @@ export const commonSend = async (
|
||||
peer.chatType === ChatType.Private
|
||||
? {
|
||||
chatType: ChatType.Private,
|
||||
peerUid: privatePeerUid,
|
||||
peerUid: privatePeerUid!,
|
||||
}
|
||||
: (peer as Peer),
|
||||
msgElements: elements,
|
||||
|
Loading…
Reference in New Issue
Block a user