mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:22:44 +00:00
fix(telegram): include replied media files in reply context (#28488)
* fix(telegram): include replied media files in reply context * fix(telegram): keep reply media fields nullable * perf(telegram): defer reply-media fetch to debounce flush * fix(telegram): gate and preserve reply media attachments * fix(telegram): preserve cached-sticker reply media context * fix: update changelog for telegram reply-media context fixes (#28488) (thanks @obviyus)
This commit is contained in:
@@ -120,6 +120,7 @@ export const getMeSpy: AnyAsyncMock = vi.fn(async () => ({
|
||||
export const sendMessageSpy: AnyAsyncMock = vi.fn(async () => ({ message_id: 77 }));
|
||||
export const sendAnimationSpy: AnyAsyncMock = vi.fn(async () => ({ message_id: 78 }));
|
||||
export const sendPhotoSpy: AnyAsyncMock = vi.fn(async () => ({ message_id: 79 }));
|
||||
export const getFileSpy: AnyAsyncMock = vi.fn(async () => ({ file_path: "media/file.jpg" }));
|
||||
|
||||
type ApiStub = {
|
||||
config: { use: (arg: unknown) => void };
|
||||
@@ -132,6 +133,7 @@ type ApiStub = {
|
||||
sendMessage: typeof sendMessageSpy;
|
||||
sendAnimation: typeof sendAnimationSpy;
|
||||
sendPhoto: typeof sendPhotoSpy;
|
||||
getFile: typeof getFileSpy;
|
||||
};
|
||||
|
||||
const apiStub: ApiStub = {
|
||||
@@ -145,6 +147,7 @@ const apiStub: ApiStub = {
|
||||
sendMessage: sendMessageSpy,
|
||||
sendAnimation: sendAnimationSpy,
|
||||
sendPhoto: sendPhotoSpy,
|
||||
getFile: getFileSpy,
|
||||
};
|
||||
|
||||
vi.mock("grammy", () => ({
|
||||
@@ -290,6 +293,8 @@ beforeEach(() => {
|
||||
sendPhotoSpy.mockResolvedValue({ message_id: 79 });
|
||||
sendMessageSpy.mockReset();
|
||||
sendMessageSpy.mockResolvedValue({ message_id: 77 });
|
||||
getFileSpy.mockReset();
|
||||
getFileSpy.mockResolvedValue({ file_path: "media/file.jpg" });
|
||||
|
||||
setMessageReactionSpy.mockReset();
|
||||
setMessageReactionSpy.mockResolvedValue(undefined);
|
||||
|
||||
Reference in New Issue
Block a user