openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
33 lines (32 loc) • 965 B
JavaScript
import { i as formatErrorMessage } from "./errors-BXgSefBE.js";
import { c as withTimeout } from "./fs-safe-aqmM_n6V.js";
import "./error-runtime-C8vbtAJt.js";
import "./text-utility-runtime-BZ3jGr-e.js";
import { t as MessagingApiClient } from "./messagingApiClient-D72iuAe_.js";
//#region extensions/line/src/probe.ts
async function probeLineBot(channelAccessToken, timeoutMs = 5e3) {
if (!channelAccessToken?.trim()) return {
ok: false,
error: "Channel access token not configured"
};
const client = new MessagingApiClient({ channelAccessToken: channelAccessToken.trim() });
try {
const profile = await withTimeout(client.getBotInfo(), timeoutMs);
return {
ok: true,
bot: {
displayName: profile.displayName,
userId: profile.userId,
basicId: profile.basicId,
pictureUrl: profile.pictureUrl
}
};
} catch (err) {
return {
ok: false,
error: formatErrorMessage(err)
};
}
}
//#endregion
export { probeLineBot as t };