fix(onebot): use canonical group request flags

This commit is contained in:
DrSmoothl committed 2026-07-10 02:42:07 +08:00
1 parent 3c73d1d5b0
commit 35958a7fc2
11 files changed
+468 -60

No files matched your search

+19
View File
@@ -67,3 +67,22 @@ export interface GroupRequestInfo {
comment: string;
filtered: boolean;
}
/** Approval tuple required by OIDB 0x10C8. The OneBot flag is opaque to
* clients, but carrying the complete tuple makes delayed handling stateless. */
export type GroupRequestHandle = Pick<
GroupRequestInfo,
'sequence' | 'groupId' | 'eventType' | 'filtered'
>;
/** Canonical SnowLuma group-request flag (version 1). */
export function formatGroupRequestFlag(handle: GroupRequestHandle): string {
return [
'slreq',
'1',
handle.sequence,
handle.groupId,
handle.eventType,
handle.filtered ? 1 : 0,
].join(':');
}