mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
422 B
TypeScript
16 lines
422 B
TypeScript
import { getCachedConverseInfo } from '../cache/cache';
|
|
import type { ChatConverseInfo } from '../model/converse';
|
|
import { appendUserDMConverse } from '../model/user';
|
|
|
|
/**
|
|
* 确保私信会话存在
|
|
*/
|
|
export async function ensureDMConverse(
|
|
converseId: string
|
|
): Promise<ChatConverseInfo> {
|
|
const converse = await getCachedConverseInfo(converseId);
|
|
await appendUserDMConverse(converseId);
|
|
|
|
return converse;
|
|
}
|