INNER CODE UNIT · TypeScript
cmdMatch
im4codes/imcodes · server/src/platform/handlers/feishu/index.ts:82
const cmdMatch = text.match(/^\/([a-z0-9_]+)(?:\s+(.*))?$/i);
if (cmdMatch) {
const command = cmdMatch[1].toLowerCase();
const argStr = (cmdMatch[2] ?? '').trim();
const args = argStr ? argStr.split(/\s+/) : [];
return {
platform: 'feishu',
botId: config.botId,
channelId,
userId,
content: argStr,
messageId,
isCommand: true,
command,
args,
raw: body,
};
}