mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 13:40:20 +00:00
fix: resolve Telegram slash command bindings from sender peer
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user