fix: resolve Telegram slash command bindings from sender peer

This commit is contained in:
Peter Steinberger
2026-03-27 23:48:27 +00:00
parent ee2220ca08
commit 1c412b1ac6
2 changed files with 39 additions and 1 deletions

View File

@@ -259,6 +259,39 @@ describe("registerPluginCommand", () => {
});
});
it("resolves Telegram native slash command bindings using the From peer", () => {
expect(
__testing.resolveBindingConversationFromCommand({
channel: "telegram",
from: "telegram:group:-100123:topic:77",
to: "slash:12345",
accountId: "default",
messageThreadId: 77,
}),
).toEqual({
channel: "telegram",
accountId: "default",
conversationId: "-100123",
threadId: 77,
});
});
it("falls back to the parsed From threadId for Telegram slash commands when messageThreadId is missing", () => {
expect(
__testing.resolveBindingConversationFromCommand({
channel: "telegram",
from: "telegram:group:-100123:topic:77",
to: "slash:12345",
accountId: "default",
}),
).toEqual({
channel: "telegram",
accountId: "default",
conversationId: "-100123",
threadId: 77,
});
});
it("does not resolve binding conversations for unsupported command channels", () => {
expect(
__testing.resolveBindingConversationFromCommand({