mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:28:28 +00:00
Revert "fix(telegram): wire sendPollTelegram into channel action handler (#16977)"
This reverts commit 7bb9a7dcfc.
This commit is contained in:
@@ -498,32 +498,6 @@ describe("telegramMessageActions", () => {
|
||||
expect(String(callPayload.messageId)).toBe("456");
|
||||
expect(callPayload.emoji).toBe("ok");
|
||||
});
|
||||
|
||||
it("routes poll action to sendPoll with question and options", async () => {
|
||||
const cfg = { channels: { telegram: { botToken: "tok" } } } as OpenClawConfig;
|
||||
|
||||
await telegramMessageActions.handleAction?.({
|
||||
channel: "telegram",
|
||||
action: "poll",
|
||||
params: {
|
||||
to: "-100123",
|
||||
pollQuestion: "Ready?",
|
||||
pollOption: ["Yes", "No", "Maybe"],
|
||||
},
|
||||
cfg,
|
||||
accountId: undefined,
|
||||
});
|
||||
|
||||
expect(handleTelegramAction).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
action: "poll",
|
||||
to: "-100123",
|
||||
question: "Ready?",
|
||||
options: ["Yes", "No", "Maybe"],
|
||||
}),
|
||||
cfg,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("signalMessageActions", () => {
|
||||
|
||||
@@ -56,9 +56,6 @@ export const telegramMessageActions: ChannelMessageActionAdapter = {
|
||||
const gate = (key: keyof TelegramActionConfig, defaultValue = true) =>
|
||||
gates.some((g) => g(key, defaultValue));
|
||||
const actions = new Set<ChannelMessageActionName>(["send"]);
|
||||
if (gate("poll")) {
|
||||
actions.add("poll");
|
||||
}
|
||||
if (gate("reactions")) {
|
||||
actions.add("react");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user