twindex-openclaw-plugin 0.5.4 → 0.5.6
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/poll-service.ts +10 -3
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "twindex",
|
|
3
3
|
"name": "Twindex",
|
|
4
4
|
"description": "Music intelligence for AI agents. Get notified about tours, merch drops, releases, and presales for your favorite artists.",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.6",
|
|
6
6
|
"skills": ["./skills"],
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
package/package.json
CHANGED
package/src/poll-service.ts
CHANGED
|
@@ -41,10 +41,18 @@ export function createNotificationService(api: any) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function getChatTarget(): string | undefined {
|
|
44
|
-
|
|
44
|
+
const raw = api.config?.plugins?.entries?.twindex?.config?.chatTarget;
|
|
45
|
+
if (!raw) return undefined;
|
|
46
|
+
// Strip channel prefix if agent included it (e.g. "telegram:123" → "123")
|
|
47
|
+
const colonIdx = raw.indexOf(":");
|
|
48
|
+
return colonIdx >= 0 ? raw.slice(colonIdx + 1) : raw;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
function getChatChannel(): string {
|
|
52
|
+
const raw = api.config?.plugins?.entries?.twindex?.config?.chatTarget ?? "";
|
|
53
|
+
// Infer channel from prefix if present (e.g. "telegram:123" → "telegram")
|
|
54
|
+
const colonIdx = raw.indexOf(":");
|
|
55
|
+
if (colonIdx > 0) return raw.slice(0, colonIdx);
|
|
48
56
|
return api.config?.plugins?.entries?.twindex?.config?.chatChannel ?? "telegram";
|
|
49
57
|
}
|
|
50
58
|
|
|
@@ -76,8 +84,7 @@ export function createNotificationService(api: any) {
|
|
|
76
84
|
|
|
77
85
|
for (const notif of unread) {
|
|
78
86
|
const message =
|
|
79
|
-
|
|
80
|
-
"Share this with the user naturally. If they seem busy, keep it brief.";
|
|
87
|
+
`🎸 ${notif.brand} — ${notif.event_type}\n${notif.summary}`;
|
|
81
88
|
|
|
82
89
|
const delivered = await sendMessage(message, channel, target);
|
|
83
90
|
if (delivered) {
|