clawgram 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channel.js +5 -0
- package/dist/gramjs-client.js +8 -0
- package/dist/helpers.js +14 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/channel.js
CHANGED
|
@@ -317,6 +317,9 @@ const createChannelPlugin = (runtimes) => {
|
|
|
317
317
|
});
|
|
318
318
|
const sendTextToConversation = async (args) => {
|
|
319
319
|
const targets = [conversationTarget, ...conversationFallbackTargets];
|
|
320
|
+
// Replies have no per-call parseMode slot — the format is an
|
|
321
|
+
// account setting (2.3.1); absent keeps plain text.
|
|
322
|
+
const replyParseMode = gram.replyParseMode;
|
|
320
323
|
let lastError;
|
|
321
324
|
for (const target of targets) {
|
|
322
325
|
try {
|
|
@@ -325,6 +328,7 @@ const createChannelPlugin = (runtimes) => {
|
|
|
325
328
|
text: args.text,
|
|
326
329
|
replyToMessageId: args.replyToMessageId,
|
|
327
330
|
messageThreadId: args.messageThreadId,
|
|
331
|
+
parseMode: replyParseMode,
|
|
328
332
|
});
|
|
329
333
|
}
|
|
330
334
|
catch (error) {
|
|
@@ -1325,6 +1329,7 @@ const createChannelPlugin = (runtimes) => {
|
|
|
1325
1329
|
targetKind,
|
|
1326
1330
|
replyToMessageId: (0, helpers_1.resolveReplyToMessageIdForTarget)(ctx.to, ctx.replyToId),
|
|
1327
1331
|
messageThreadId,
|
|
1332
|
+
parseMode: gram.replyParseMode,
|
|
1328
1333
|
});
|
|
1329
1334
|
actionLog.info("clawgram outbound sendText completed", {
|
|
1330
1335
|
accountId: ctx.accountId,
|
package/dist/gramjs-client.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GramJsClientManager = void 0;
|
|
4
4
|
const telegram_1 = require("telegram");
|
|
5
5
|
const sessions_1 = require("telegram/sessions");
|
|
6
|
+
const helpers_1 = require("./helpers");
|
|
6
7
|
const proxy_config_1 = require("./proxy-config");
|
|
7
8
|
const secret_refs_1 = require("./secret-refs");
|
|
8
9
|
const history_1 = require("./history");
|
|
@@ -289,6 +290,13 @@ class GramJsClientManager {
|
|
|
289
290
|
chatType: inferChatTypeFromRaw(chatId ?? raw)
|
|
290
291
|
};
|
|
291
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Reply format for this account, validated once at read time.
|
|
295
|
+
* The reply pipeline has no per-call parseMode slot (2.3.1).
|
|
296
|
+
*/
|
|
297
|
+
get replyParseMode() {
|
|
298
|
+
return (0, helpers_1.normalizeParseMode)(this.config.replyParseMode);
|
|
299
|
+
}
|
|
292
300
|
async sendText(args) {
|
|
293
301
|
const resolved = await this.resolvePeer(args.target, { kind: args.targetKind });
|
|
294
302
|
const messageThreadId = args.messageThreadId ?? resolved.messageThreadId;
|
package/dist/helpers.js
CHANGED
|
@@ -34,6 +34,7 @@ exports.isReplyToSelfMessage = isReplyToSelfMessage;
|
|
|
34
34
|
exports.resolveSenderProfile = resolveSenderProfile;
|
|
35
35
|
exports.resolveSenderProfileWithTimeout = resolveSenderProfileWithTimeout;
|
|
36
36
|
exports.normalizeParseMode = normalizeParseMode;
|
|
37
|
+
exports.resolveReplyParseMode = resolveReplyParseMode;
|
|
37
38
|
const node_fs_1 = require("node:fs");
|
|
38
39
|
const node_path_1 = __importDefault(require("node:path"));
|
|
39
40
|
const core_1 = require("openclaw/plugin-sdk/core");
|
|
@@ -510,3 +511,16 @@ function normalizeParseMode(raw) {
|
|
|
510
511
|
return "html";
|
|
511
512
|
throw new Error(`clawgram: invalid parseMode "${String(raw)}" — use "markdown" or "html"`);
|
|
512
513
|
}
|
|
514
|
+
/**
|
|
515
|
+
* Reply parse mode for the inbound reply path (2.3.1). The action `send`
|
|
516
|
+
* takes parseMode per-call, but replies to a mention run through the reply
|
|
517
|
+
* pipeline, which has no per-call slot — so the format is a channel setting:
|
|
518
|
+
* `channels.clawgram.accounts.<id>.replyParseMode: "markdown" | "html"`.
|
|
519
|
+
* Absent means plain text, exactly as before 2.3.1. An invalid value throws
|
|
520
|
+
* at config-read time, loud and early, rather than shipping raw markup.
|
|
521
|
+
*/
|
|
522
|
+
function resolveReplyParseMode(cfg, accountId) {
|
|
523
|
+
const channel = cfg?.channels?.["clawgram"];
|
|
524
|
+
const account = channel?.accounts?.[accountId] ?? channel;
|
|
525
|
+
return normalizeParseMode(account?.replyParseMode);
|
|
526
|
+
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "clawgram",
|
|
3
3
|
"name": "Clawgram",
|
|
4
4
|
"description": "Clawgram — personal Telegram (MTProto userbot) channel for OpenClaw. Your AI assistant reads and responds as you.",
|
|
5
|
-
"version": "2.3.
|
|
5
|
+
"version": "2.3.1",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
package/package.json
CHANGED