-
Notifications
You must be signed in to change notification settings - Fork 85
Add rich menu apis #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
eucyt
merged 6 commits into
line:main
from
4geru:4geru/add-rich-menu-list-set-default-apis
Jun 9, 2025
+92
−2
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
771051d
add rich menu apis
4geru 60a8d18
add delete and cancel apis
4geru 87c7e56
merge project path and image path
4geru 5a0c737
update the README.md
4geru 6c55078
Merge remote-tracking branch 'origin/main' into 4geru/add-rich-menu-l…
4geru 595c7fd
remove set_rich_menu_image
4geru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -229,6 +229,64 @@ server.tool( | |
| }, | ||
| ); | ||
|
|
||
| server.tool( | ||
| "get_rich_menu_list", | ||
| "Get the list of rich menus associated with your LINE Official Account.", | ||
| {}, | ||
| async () => { | ||
| try { | ||
| const response = await messagingApiClient.getRichMenuList(); | ||
| return createSuccessResponse(response); | ||
| } catch (error) { | ||
| return createErrorResponse( | ||
| `Failed to broadcast message: ${error.message}`, | ||
| ); | ||
| } | ||
| }, | ||
| ); | ||
|
|
||
| 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_default", | ||
| "Set a rich menu as the default rich menu.", | ||
| { | ||
| richMenuId: z | ||
| .string() | ||
| .describe("The ID of the rich menu to set as default."), | ||
| }, | ||
| async ({ richMenuId }) => { | ||
| const response = await messagingApiClient.setDefaultRichMenu(richMenuId); | ||
| return createSuccessResponse(response); | ||
| }, | ||
| ); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| server.tool( | ||
| "cancel_rich_menu_default", | ||
| "Cancel the default rich menu.", | ||
| {}, | ||
| async () => { | ||
| const response = await messagingApiClient.cancelDefaultRichMenu(); | ||
| return createSuccessResponse(response); | ||
| }, | ||
| ); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| async function main() { | ||
| if (!process.env.CHANNEL_ACCESS_TOKEN) { | ||
| console.error("Please set CHANNEL_ACCESS_TOKEN"); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete and list