@@ -498,8 +498,12 @@ def link_rich_menu_to_user(self, user_id, rich_menu_id, timeout=None):
498498
499499 https://developers.line.me/en/docs/messaging-api/reference/#link-rich-menu-to-user
500500
501- :param str user_id: ID of an uploaded rich menu
502- :param str rich_menu_id: ID of the user
501+ :param str user_id: ID of the user
502+ :param str rich_menu_id: ID of an uploaded rich menu
503+ :param timeout: (optional) How long to wait for the server
504+ to send data before giving up, as a float,
505+ or a (connect timeout, read timeout) float tuple.
506+ Default is self.http_client.timeout
503507 :type timeout: float | tuple(float, float)
504508 """
505509 self ._post (
@@ -510,6 +514,30 @@ def link_rich_menu_to_user(self, user_id, rich_menu_id, timeout=None):
510514 timeout = timeout
511515 )
512516
517+ def link_rich_menu_to_users (self , user_ids , rich_menu_id , timeout = None ):
518+ """Links a rich menu to multiple users.
519+
520+ https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users
521+
522+ :param user_ids: user IDs
523+ Max: 150 users
524+ :type user_ids: list[str]
525+ :param str rich_menu_id: ID of an uploaded rich menu
526+ :param timeout: (optional) How long to wait for the server
527+ to send data before giving up, as a float,
528+ or a (connect timeout, read timeout) float tuple.
529+ Default is self.http_client.timeout
530+ :type timeout: float | tuple(float, float)
531+ """
532+ self ._post (
533+ '/v2/bot/richmenu/bulk/link' ,
534+ data = json .dumps ({
535+ 'userIds' : user_ids ,
536+ 'richMenuId' : rich_menu_id ,
537+ }),
538+ timeout = timeout
539+ )
540+
513541 def unlink_rich_menu_from_user (self , user_id , timeout = None ):
514542 """Call unlink rich menu from user API.
515543
@@ -527,6 +555,28 @@ def unlink_rich_menu_from_user(self, user_id, timeout=None):
527555 timeout = timeout
528556 )
529557
558+ def unlink_rich_menu_from_users (self , user_ids , timeout = None ):
559+ """Unlinks rich menus from multiple users.
560+
561+ https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users
562+
563+ :param user_ids: user IDs
564+ Max: 150 users
565+ :type user_ids: list[str]
566+ :param timeout: (optional) How long to wait for the server
567+ to send data before giving up, as a float,
568+ or a (connect timeout, read timeout) float tuple.
569+ Default is self.http_client.timeout
570+ :type timeout: float | tuple(float, float)
571+ """
572+ self ._post (
573+ '/v2/bot/richmenu/bulk/unlink' ,
574+ data = json .dumps ({
575+ 'userIds' : user_ids ,
576+ }),
577+ timeout = timeout
578+ )
579+
530580 def get_rich_menu_image (self , rich_menu_id , timeout = None ):
531581 """Call download rich menu image API.
532582
@@ -595,6 +645,59 @@ def get_rich_menu_list(self, timeout=None):
595645
596646 return result
597647
648+ def set_default_rich_menu (self , rich_menu_id , timeout = None ):
649+ """Set the default rich menu.
650+
651+ https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu
652+
653+ :param str rich_menu_id: ID of an uploaded rich menu
654+ :param timeout: (optional) How long to wait for the server
655+ to send data before giving up, as a float,
656+ or a (connect timeout, read timeout) float tuple.
657+ Default is self.http_client.timeout
658+ :type timeout: float | tuple(float, float)
659+ """
660+ self ._post (
661+ '/v2/bot/user/all/richmenu/{rich_menu_id}' .format (
662+ rich_menu_id = rich_menu_id ,
663+ ),
664+ timeout = timeout
665+ )
666+
667+ def get_default_rich_menu (self , timeout = None ):
668+ """Get the ID of the default rich menu set with the Messaging API.
669+
670+ https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id
671+
672+ :param timeout: (optional) How long to wait for the server
673+ to send data before giving up, as a float,
674+ or a (connect timeout, read timeout) float tuple.
675+ Default is self.http_client.timeout
676+ :type timeout: float | tuple(float, float)
677+ """
678+ response = self ._get (
679+ '/v2/bot/user/all/richmenu' ,
680+ timeout = timeout
681+ )
682+
683+ return response .json .get ('richMenuId' )
684+
685+ def cancel_default_rich_menu (self , timeout = None ):
686+ """Cancel the default rich menu set with the Messaging API.
687+
688+ https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu
689+
690+ :param timeout: (optional) How long to wait for the server
691+ to send data before giving up, as a float,
692+ or a (connect timeout, read timeout) float tuple.
693+ Default is self.http_client.timeout
694+ :type timeout: float | tuple(float, float)
695+ """
696+ self ._delete (
697+ '/v2/bot/user/all/richmenu' ,
698+ timeout = timeout
699+ )
700+
598701 def get_message_quota (self , timeout = None ):
599702 """Call Get the target limit for additional messages.
600703
0 commit comments