LINE.Bot.LineModule (line_bot_sdk v0.1.0)

Copy Markdown

API calls for all endpoints tagged LineModule.

Summary

Functions

If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel.

The module channel admin calls the Detach API to detach the module channel from a LINE Official Account.

Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels.

Create a new LineModule client.

To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API.

Functions

acquire_chat_control(client, chat_id, optional_args \\ [], client_opts \\ [])

If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • chat_id (String.t/0): The userId, roomId, or groupId
  • optional_args (keyword): Optional parameters
    • :body (t:AcquireChatControlRequest/0):
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, nil} on success
  • {:error, Req.Response.t} on failure

detach_module(client, optional_args \\ [], client_opts \\ [])

The module channel admin calls the Detach API to detach the module channel from a LINE Official Account.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • optional_args (keyword): Optional parameters
    • :body (t:DetachModuleRequest/0):
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, nil} on success
  • {:error, Req.Response.t} on failure

get_modules(client, optional_args \\ [], client_opts \\ [])

Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels.

Parameters

  • client (Req.Request.t/0): Client to make request with
  • optional_args (keyword): Optional parameters
    • :start (String.t/0): Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array.
    • :limit (integer()/0): Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100
  • client_opts (keyword/0): Options to pass to Req.request

Returns

  • {:ok, LINE.Bot.Model.GetModulesResponse.t} on success
  • {:error, Req.Response.t} on failure

new(options \\ [])

Create a new LineModule client.

Options

  • :base_url - base URL for requests (default: "https://api.line.me")
  • :channel_token (required) - channel access token for Bearer authorization
  • :plug - plug to use for testing (see Req.new/1)

release_chat_control(client, chat_id, client_opts \\ [])

To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API.

Parameters

Returns

  • {:ok, nil} on success
  • {:error, Req.Response.t} on failure