Skip to content

Commit efba069

Browse files
authored
Merge pull request #347 from kcvlex/issue/346
Add validateRichMenu
2 parents c988035 + febfaff commit efba069

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
@@ -789,6 +789,13 @@ export default class Client {
789789
);
790790
return ensureJSON(res);
791791
}
792+
793+
public async validateRichMenu(richMenu: Types.RichMenu): Promise<{}> {
794+
return await this.http.post<{}>(
795+
`${MESSAGING_API_PREFIX}/richmenu/validate`,
796+
richMenu,
797+
);
798+
}
792799
}
793800

794801
export class OAuth {

test/client.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,17 @@ describe("client", () => {
11421142
await client.getBotInfo();
11431143
equal(scope.isDone(), true);
11441144
});
1145+
1146+
it("validateRichMenu", async () => {
1147+
const scope = mockPost(
1148+
MESSAGING_API_PREFIX,
1149+
`/richmenu/validate`,
1150+
richMenu,
1151+
);
1152+
1153+
await client.validateRichMenu(richMenu);
1154+
equal(scope.isDone(), true);
1155+
});
11451156
});
11461157

11471158
const oauth = new OAuth();

0 commit comments

Comments
 (0)