Skip to content

Commit febfaff

Browse files
committed
Add validateRichMenu
1 parent 1b668fc commit febfaff

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/client.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,13 @@ export default class Client {
722722
);
723723
return ensureJSON(res);
724724
}
725+
726+
public async validateRichMenu(richMenu: Types.RichMenu): Promise<{}> {
727+
return await this.http.post<{}>(
728+
`${MESSAGING_API_PREFIX}/richmenu/validate`,
729+
richMenu,
730+
);
731+
}
725732
}
726733

727734
export class OAuth {

test/client.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,17 @@ describe("client", () => {
10531053
await client.getBotInfo();
10541054
equal(scope.isDone(), true);
10551055
});
1056+
1057+
it("validateRichMenu", async () => {
1058+
const scope = mockPost(
1059+
MESSAGING_API_PREFIX,
1060+
`/richmenu/validate`,
1061+
richMenu,
1062+
);
1063+
1064+
await client.validateRichMenu(richMenu);
1065+
equal(scope.isDone(), true);
1066+
});
10561067
});
10571068

10581069
const oauth = new OAuth();

0 commit comments

Comments
 (0)