Skip to content

Commit 2f08f65

Browse files
committed
refactor
1 parent a95e052 commit 2f08f65

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

lib/line/bot/client.rb

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -363,44 +363,23 @@ def unlink_user_rich_menu(user_id)
363363
delete(endpoint_path)
364364
end
365365

366-
# To link rich menus to multiple users at a time
366+
# To link a rich menu to multiple users at a time
367367
#
368368
# @param user_ids [Array] ID of the user
369369
# @param rich_menu_id [String] ID of the uploaded rich menu
370370
#
371371
# @return [Net::HTTPResponse]
372372
def bulk_link_rich_menus(user_ids, rich_menu_id)
373-
request = Request.new do |config|
374-
config.httpclient = httpclient
375-
config.endpoint = endpoint
376-
config.endpoint_path = "/bot/richmenu/bulk/link"
377-
config.credentials = credentials
378-
config.payload = {
379-
richMenuId: rich_menu_id,
380-
userIds: user_ids,
381-
}.to_json
382-
end
383-
384-
request.post
373+
post("/bot/richmenu/bulk/link", {richMenuId: rich_menu_id, userIds: user_ids}.to_json)
385374
end
386375

387-
# To unlink rich menus from multiple users at a time
376+
# To unlink a rich menu from multiple users at a time
388377
#
389378
# @param user_ids [Array] ID of the user
390379
#
391380
# @return [Net::HTTPResponse]
392381
def bulk_unlink_rich_menus(user_ids)
393-
request = Request.new do |config|
394-
config.httpclient = httpclient
395-
config.endpoint = endpoint
396-
config.endpoint_path = "/bot/richmenu/bulk/unlink"
397-
config.credentials = credentials
398-
config.payload = {
399-
userIds: user_ids,
400-
}.to_json
401-
end
402-
403-
request.post
382+
post("/bot/richmenu/bulk/unlink", {userIds: user_ids}.to_json)
404383
end
405384

406385
# Download an image associated with a rich menu

0 commit comments

Comments
 (0)