forked from bai/curriculum-project-hub
feat: redesign Feishu project console
This commit is contained in:
@@ -47,8 +47,8 @@ export class MessageBatcher {
|
||||
this.extendedDebounceMs = options.extendedDebounceMs ?? DEFAULT_OPTIONS.extendedDebounceMs;
|
||||
}
|
||||
|
||||
async enqueue(chatId: string, senderOpenId: string, text: string): Promise<void> {
|
||||
const key = messageBatchKey(chatId, senderOpenId);
|
||||
async enqueue(chatId: string, senderOpenId: string, text: string, discriminator?: string): Promise<void> {
|
||||
const key = messageBatchKey(chatId, senderOpenId, discriminator);
|
||||
await this.runSerial(key, async () => {
|
||||
const existing = this.pending.get(key);
|
||||
const batch =
|
||||
@@ -120,6 +120,8 @@ export class MessageBatcher {
|
||||
}
|
||||
}
|
||||
|
||||
export function messageBatchKey(chatId: string, senderOpenId: string): string {
|
||||
return `${chatId}:${senderOpenId}`;
|
||||
export function messageBatchKey(chatId: string, senderOpenId: string, discriminator?: string): string {
|
||||
return discriminator === undefined
|
||||
? `${chatId}:${senderOpenId}`
|
||||
: `${chatId}:${senderOpenId}:${discriminator}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user