Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add delete and cancel apis
  • Loading branch information
4geru committed May 28, 2025
commit 60a8d185ac533c7bfcbe3762814b1df455e54cb8
28 changes: 28 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,24 @@ server.tool(
},
);

server.tool(
"delete_rich_menu",
"Delete a rich menu from your LINE Official Account.",
{
richMenuId: z.string().describe("The ID of the rich menu to delete."),
},
async ({ richMenuId }) => {
try {
const response = await messagingApiClient.deleteRichMenu(richMenuId);
return createSuccessResponse(response);
} catch (error) {
return createErrorResponse(
`Failed to delete rich menu: ${error.message}`,
);
}
},
);

server.tool(
"set_rich_menu_image",
"Update a rich menu associated with your LINE Official Account.",
Expand Down Expand Up @@ -294,6 +312,16 @@ server.tool(
},
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set default

スクリーンショット 2025-05-29 9 02 18


server.tool(
"cancel_rich_menu_default",
"Cancel the default rich menu.",
{},
async () => {
const response = await messagingApiClient.cancelDefaultRichMenu();
return createSuccessResponse(response);
},
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

スクリーンショット 2025-05-29 9 04 02


async function main() {
if (!process.env.CHANNEL_ACCESS_TOKEN) {
console.error("Please set CHANNEL_ACCESS_TOKEN");
Expand Down