Skip to content

@line/bot-sdk


@line/bot-sdk / moduleOperation / LineModuleClient

Class: LineModuleClient

Defined in: lib/module/api/lineModuleClient.ts:52

See

LineBotClient for a unified interface that wraps this client.

Constructors

Constructor

new LineModuleClient(config): LineModuleClient

Defined in: lib/module/api/lineModuleClient.ts:68

Initializes a new LineModuleClient.

Parameters

config

httpClientConfig

Configuration for this API client.

Returns

LineModuleClient

Example

ts
const client = new LineModuleClient({
  channelAccessToken: process.env.LINE_CHANNEL_ACCESS_TOKEN!,
});

Methods

acquireChatControl()

acquireChatControl(chatId, acquireChatControlRequest?): Promise<MessageAPIResponseBase>

Defined in: lib/module/api/lineModuleClient.ts:88

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. Calls POST https://api.line.me/v2/bot/chat/{chatId}/control/acquire. To inspect the HTTP status code or response headers, use acquireChatControlWithHttpInfo.

Parameters

chatId

string

The userId, roomId, or groupId

acquireChatControlRequest?

AcquireChatControlRequest

Returns

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See

LINE Developers documentation


acquireChatControlWithHttpInfo()

acquireChatControlWithHttpInfo(chatId, acquireChatControlRequest?): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/module/api/lineModuleClient.ts:109

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. Calls POST https://api.line.me/v2/bot/chat/{chatId}/control/acquire. This method returns the response body together with the underlying httpResponse.

Parameters

chatId

string

The userId, roomId, or groupId

acquireChatControlRequest?

AcquireChatControlRequest

Returns

Promise<ApiResponseType<MessageAPIResponseBase>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


detachModule()

detachModule(detachModuleRequest?): Promise<MessageAPIResponseBase>

Defined in: lib/module/api/lineModuleClient.ts:132

The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. Calls POST https://api.line.me/v2/bot/channel/detach. To inspect the HTTP status code or response headers, use detachModuleWithHttpInfo.

Parameters

detachModuleRequest?

DetachModuleRequest

Returns

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See

LINE Developers documentation


detachModuleWithHttpInfo()

detachModuleWithHttpInfo(detachModuleRequest?): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/module/api/lineModuleClient.ts:146

The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. Calls POST https://api.line.me/v2/bot/channel/detach. This method returns the response body together with the underlying httpResponse.

Parameters

detachModuleRequest?

DetachModuleRequest

Returns

Promise<ApiResponseType<MessageAPIResponseBase>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


getModules()

getModules(start?, limit?): Promise<GetModulesResponse>

Defined in: lib/module/api/lineModuleClient.ts:165

Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. Calls GET https://api.line.me/v2/bot/list. To inspect the HTTP status code or response headers, use getModulesWithHttpInfo.

Parameters

start?

string

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?

number

Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100

Returns

Promise<GetModulesResponse>

A promise resolving to the response body.

See

LINE Developers documentation


getModulesWithHttpInfo()

getModulesWithHttpInfo(start?, limit?): Promise<ApiResponseType<GetModulesResponse>>

Defined in: lib/module/api/lineModuleClient.ts:181

Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. Calls GET https://api.line.me/v2/bot/list. This method returns the response body together with the underlying httpResponse.

Parameters

start?

string

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?

number

Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100

Returns

Promise<ApiResponseType<GetModulesResponse>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation


releaseChatControl()

releaseChatControl(chatId): Promise<MessageAPIResponseBase>

Defined in: lib/module/api/lineModuleClient.ts:211

To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. Calls POST https://api.line.me/v2/bot/chat/{chatId}/control/release. To inspect the HTTP status code or response headers, use releaseChatControlWithHttpInfo.

Parameters

chatId

string

The userId, roomId, or groupId

Returns

Promise<MessageAPIResponseBase>

A promise resolving to the response body.

See

LINE Developers documentation


releaseChatControlWithHttpInfo()

releaseChatControlWithHttpInfo(chatId): Promise<ApiResponseType<MessageAPIResponseBase>>

Defined in: lib/module/api/lineModuleClient.ts:225

To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. Calls POST https://api.line.me/v2/bot/chat/{chatId}/control/release. This method returns the response body together with the underlying httpResponse.

Parameters

chatId

string

The userId, roomId, or groupId

Returns

Promise<ApiResponseType<MessageAPIResponseBase>>

A promise resolving to the response body together with the underlying httpResponse.

See

LINE Developers documentation