mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 21:01:43 +03:00
chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.
This commit is contained in:
@@ -121,9 +121,7 @@ export async function deliverLineAutoReply(params: {
|
||||
: { text: "", flexMessages: [] };
|
||||
|
||||
for (const flexMsg of processed.flexMessages) {
|
||||
richMessages.push(
|
||||
deps.createFlexMessage(flexMsg.altText.slice(0, 400), flexMsg.contents as FlexContainer),
|
||||
);
|
||||
richMessages.push(deps.createFlexMessage(flexMsg.altText.slice(0, 400), flexMsg.contents));
|
||||
}
|
||||
|
||||
const chunks = processed.text ? deps.chunkMarkdownText(processed.text, textLimit) : [];
|
||||
|
||||
@@ -102,10 +102,10 @@ function describeStickerKeywords(sticker: StickerEventMessage): string {
|
||||
|
||||
function extractMessageText(message: MessageEvent["message"]): string {
|
||||
if (message.type === "text") {
|
||||
return (message as TextEventMessage).text;
|
||||
return message.text;
|
||||
}
|
||||
if (message.type === "location") {
|
||||
const loc = message as LocationEventMessage;
|
||||
const loc = message;
|
||||
return (
|
||||
formatLocationText({
|
||||
latitude: loc.latitude,
|
||||
@@ -116,7 +116,7 @@ function extractMessageText(message: MessageEvent["message"]): string {
|
||||
);
|
||||
}
|
||||
if (message.type === "sticker") {
|
||||
const sticker = message as StickerEventMessage;
|
||||
const sticker = message;
|
||||
const packageName = STICKER_PACKAGES[sticker.packageId] ?? "sticker";
|
||||
const keywords = describeStickerKeywords(sticker);
|
||||
|
||||
@@ -222,7 +222,7 @@ export async function buildLineMessageContext(params: BuildLineMessageContextPar
|
||||
// Build location context if applicable
|
||||
let locationContext: ReturnType<typeof toLocationContext> | undefined;
|
||||
if (message.type === "location") {
|
||||
const loc = message as LocationEventMessage;
|
||||
const loc = message;
|
||||
locationContext = toLocationContext({
|
||||
latitude: loc.latitude,
|
||||
longitude: loc.longitude,
|
||||
|
||||
@@ -252,7 +252,7 @@ export function createImageCard(
|
||||
};
|
||||
|
||||
if (body && bubble.body) {
|
||||
(bubble.body as FlexBox).contents.push({
|
||||
bubble.body.contents.push({
|
||||
type: "text",
|
||||
text: body,
|
||||
size: "md",
|
||||
|
||||
@@ -48,7 +48,7 @@ export async function sendLineReplyChunks(
|
||||
if (hasQuickReplies && remaining.length === 0 && replyMessages.length > 0) {
|
||||
const lastIndex = replyMessages.length - 1;
|
||||
replyMessages[lastIndex] = params.createTextMessageWithQuickReplies(
|
||||
replyBatch[lastIndex]!,
|
||||
replyBatch[lastIndex],
|
||||
params.quickReplies!,
|
||||
);
|
||||
}
|
||||
@@ -63,12 +63,12 @@ export async function sendLineReplyChunks(
|
||||
if (isLastChunk && hasQuickReplies) {
|
||||
await params.pushTextMessageWithQuickReplies(
|
||||
params.to,
|
||||
remaining[i]!,
|
||||
remaining[i],
|
||||
params.quickReplies!,
|
||||
{ accountId: params.accountId },
|
||||
);
|
||||
} else {
|
||||
await params.pushMessageLine(params.to, remaining[i]!, {
|
||||
await params.pushMessageLine(params.to, remaining[i], {
|
||||
accountId: params.accountId,
|
||||
});
|
||||
}
|
||||
@@ -86,12 +86,12 @@ export async function sendLineReplyChunks(
|
||||
if (isLastChunk && hasQuickReplies) {
|
||||
await params.pushTextMessageWithQuickReplies(
|
||||
params.to,
|
||||
params.chunks[i]!,
|
||||
params.chunks[i],
|
||||
params.quickReplies!,
|
||||
{ accountId: params.accountId },
|
||||
);
|
||||
} else {
|
||||
await params.pushMessageLine(params.to, params.chunks[i]!, {
|
||||
await params.pushMessageLine(params.to, params.chunks[i], {
|
||||
accountId: params.accountId,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user