/** * Centralized API route templates for the QQ Open Platform. * * Eliminates C2C/Group path duplication by parameterizing on `ChatScope`. * Inspired by `bot-node-sdk/src/openapi/v1/resource.ts`.
*/
import type { ChatScope } from "../types.js";
/** * Build the message-send path for C2C or Group. * * - C2C: `/v2/users/{id}/messages` * - Group: `/v2/groups/{id}/messages`
*/
export function messagePath(scope: ChatScope, targetId: string): string { return scope === "c2c" ? `/v2/users/${targetId}/messages` : `/v2/groups/${targetId}/messages`;
}
/** * Generate a message sequence number in the 0..65535 range. * * Used by both `messages.ts` and `media.ts` to avoid duplicate definitions.
*/
export function getNextMsgSeq(_msgId: string): number { const timePart = Date.now() % 100_000_000; const random = Math.floor(Math.random() * 65536); return (timePart ^ random) % 65536;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-05)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.