{"record":{"id":"5953367769e3e10c","repo":"nanocoai/nanoclaw","slug":"channel-type-platform-id-and-text-are-requi","errorCode":null,"errorMessage":"--channel-type, --platform-id and --text are required","messagePattern":"--channel-type, --platform-id and --text are required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/resources/messaging-groups.ts","lineNumber":102,"sourceCode":"      );\n      return;\n    }\n    // is_group carries its static default (0) only after this hook runs, so\n    // treat \"not provided\" as the same DM context the static default means.\n    const isGroup = Number(values.is_group ?? 0) === 1;\n    values.unknown_sender_policy = resolveUnknownSenderPolicy(channelKey, isGroup, channelType);\n  },\n  customOperations: {\n    send: {\n      access: 'approval',\n      description:\n        'Inject a message into a messaging group as if a sender posted it, waking the wired agent — used to send a welcome on first wire. Use --channel-type, --platform-id, --text, optionally --instance, --sender-id, --sender.',\n      handler: async (args) => {\n        const channelType = args.channel_type as string;\n        const platformId = args.platform_id as string;\n        const text = args.text as string;\n        if (!channelType || !platformId || !text) {\n          throw new Error('--channel-type, --platform-id and --text are required');\n        }\n        const instance = (args.instance as string) ?? channelType;\n        const mg = await getMessagingGroupByPlatform(channelType, platformId, instance);\n        if (!mg) {\n          throw new Error(`no messaging group for ${channelType} ${platformId} — create + wire it first`);\n        }\n        // Build the same InboundEvent the CLI admin transport (src/channels/cli.ts)\n        // emits for a routed message, and route it in-process. The sender id should\n        // be a wired user (e.g. the owner just granted) so the access gate passes.\n        await routeInbound({\n          channelType,\n          instance,\n          platformId,\n          threadId: platformId,\n          message: {\n            id: `send-${randomUUID()}`,\n            kind: 'chat',\n            timestamp: new Date().toISOString(),","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/nanocoai/nanoclaw/blob/294ef2aee85218b23ad30eda9dfe10e590b54a8c/src/cli/resources/messaging-groups.ts#L84-L120","documentation":"Thrown by `ncl messaging-groups inject` when any of --channel-type, --platform-id, or --text is missing. These three values are the minimum needed to locate the messaging group and construct the injected inbound message.","triggerScenarios":"Calling inject with only --text, omitting --platform-id, or passing the message body via a flag the handler does not read.","commonSituations":"Operator assumes the messaging group is resolved from an id or name instead of the (channelType, platformId, instance) triple; scripting with unset variables.","solutions":["Pass all three: `ncl messaging-groups inject --channel-type telegram --platform-id <chat-id> --text \"hello\"`","Find the platform id via `ncl messaging-groups list`","Add --instance only if the adapter runs under a non-default instance name"],"exampleFix":"// before\nncl messaging-groups inject --text \"Welcome!\"\n// after\nncl messaging-groups inject --channel-type telegram --platform-id -1001234 --text \"Welcome!\"","handlingStrategy":"validation","validationCode":"if (!channelType || !platformId || !text) throw new Error('inject requires channel-type, platform-id, text');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pull channel_type/platform_id from `ncl messaging-groups list --json` instead of typing them","Build inject calls from the group row itself"],"tags":["cli","missing-argument","messaging-groups"],"backgroundTag":"missing-cli-flag","analyzedSha":"294ef2aee85218b23ad30eda9dfe10e590b54a8c","analyzedAt":"2026-08-28T13:59:10.357Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}