mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-09 05:19:32 +08:00
fix: clean up plugin linting and types
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
"oxc/no-async-endpoint-handlers": "off",
|
||||
"oxc/no-map-spread": "off",
|
||||
"typescript/no-extraneous-class": "off",
|
||||
"typescript/no-redundant-type-constituents": "off",
|
||||
"typescript/no-unnecessary-template-expression": "off",
|
||||
"typescript/no-unsafe-type-assertion": "off",
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
|
||||
@@ -53,7 +53,7 @@ function resolveAccountConfig(
|
||||
if (!accounts || typeof accounts !== "object") {
|
||||
return undefined;
|
||||
}
|
||||
return accounts[accountId] as GoogleChatAccountConfig | undefined;
|
||||
return accounts[accountId];
|
||||
}
|
||||
|
||||
function mergeGoogleChatAccountConfig(
|
||||
|
||||
@@ -347,9 +347,10 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
|
||||
const createQuickReplyItems = runtime.channel.line.createQuickReplyItems;
|
||||
|
||||
let lastResult: { messageId: string; chatId: string } | null = null;
|
||||
const hasQuickReplies = Boolean(lineData.quickReplies?.length);
|
||||
const quickReplies = lineData.quickReplies ?? [];
|
||||
const hasQuickReplies = quickReplies.length > 0;
|
||||
const quickReply = hasQuickReplies
|
||||
? createQuickReplyItems(lineData.quickReplies!)
|
||||
? createQuickReplyItems(quickReplies)
|
||||
: undefined;
|
||||
|
||||
const sendMessageBatch = async (messages: Array<Record<string, unknown>>) => {
|
||||
@@ -433,7 +434,7 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
|
||||
for (let i = 0; i < chunks.length; i += 1) {
|
||||
const isLast = i === chunks.length - 1;
|
||||
if (isLast && hasQuickReplies) {
|
||||
lastResult = await sendQuickReplies(to, chunks[i], lineData.quickReplies!, {
|
||||
lastResult = await sendQuickReplies(to, chunks[i], quickReplies, {
|
||||
verbose: false,
|
||||
accountId: accountId ?? undefined,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user