fix(cron): parse telegram targets with prefixes (thanks @mitschabaude-bot)

This commit is contained in:
Peter Steinberger
2026-01-08 21:20:59 +01:00
parent 2afb75d508
commit 5fea53d89c
3 changed files with 27 additions and 1 deletions

View File

@@ -716,4 +716,20 @@ describe("parseTelegramTarget", () => {
topicId: undefined,
});
});
it("strips internal telegram prefix", () => {
expect(parseTelegramTarget("telegram:123")).toEqual({
chatId: "123",
topicId: undefined,
});
});
it("strips internal telegram + group prefixes before parsing topic", () => {
expect(parseTelegramTarget("telegram:group:-1001234567890:topic:456")).toEqual(
{
chatId: "-1001234567890",
topicId: 456,
},
);
});
});