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,13 +10,17 @@ export const commonSend = async (
|
|||||||
peer: Partial<Peer>,
|
peer: Partial<Peer>,
|
||||||
elements: O.Partial<Element, 'deep'>[],
|
elements: O.Partial<Element, 'deep'>[],
|
||||||
) => {
|
) => {
|
||||||
const privatePeerUid = await ctx.chronocat.uix.getUid2(peer.peerUid!)
|
let privatePeerUid: string | undefined = undefined
|
||||||
if (!privatePeerUid) {
|
|
||||||
ctx.chronocat.l.error('内部错误', {
|
if (peer.chatType === ChatType.Private) {
|
||||||
code: 2152,
|
privatePeerUid = await ctx.chronocat.uix.getUid2(peer.peerUid!)
|
||||||
throw: true,
|
if (!privatePeerUid) {
|
||||||
})
|
ctx.chronocat.l.error('内部错误', {
|
||||||
return Promise.resolve<RedMessage>(undefined as unknown as RedMessage)
|
code: 2152,
|
||||||
|
throw: true,
|
||||||
|
})
|
||||||
|
return Promise.resolve<RedMessage>(undefined as unknown as RedMessage)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const param = {
|
const param = {
|
||||||
@ -26,7 +30,7 @@ export const commonSend = async (
|
|||||||
peer.chatType === ChatType.Private
|
peer.chatType === ChatType.Private
|
||||||
? {
|
? {
|
||||||
chatType: ChatType.Private,
|
chatType: ChatType.Private,
|
||||||
peerUid: privatePeerUid,
|
peerUid: privatePeerUid!,
|
||||||
}
|
}
|
||||||
: (peer as Peer),
|
: (peer as Peer),
|
||||||
msgElements: elements,
|
msgElements: elements,
|
||||||
|
Loading…
Reference in New Issue
Block a user