mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-20 07:54:36 +00:00
refactor(line): reuse reply chunk deps type
This commit is contained in:
@@ -2,7 +2,7 @@ import type { messagingApi } from "@line/bot-sdk";
|
||||
import type { ReplyPayload } from "../auto-reply/types.js";
|
||||
import type { FlexContainer } from "./flex-templates.js";
|
||||
import type { ProcessedLineMessage } from "./markdown-to-line.js";
|
||||
import type { LineReplyMessage, SendLineReplyChunksParams } from "./reply-chunks.js";
|
||||
import type { SendLineReplyChunksParams } from "./reply-chunks.js";
|
||||
import type { LineChannelData, LineTemplateMessagePayload } from "./types.js";
|
||||
|
||||
export type LineAutoReplyDeps = {
|
||||
@@ -12,19 +12,6 @@ export type LineAutoReplyDeps = {
|
||||
processLineMessage: (text: string) => ProcessedLineMessage;
|
||||
chunkMarkdownText: (text: string, limit: number) => string[];
|
||||
sendLineReplyChunks: (params: SendLineReplyChunksParams) => Promise<{ replyTokenUsed: boolean }>;
|
||||
replyMessageLine: (
|
||||
replyToken: string,
|
||||
messages: messagingApi.Message[],
|
||||
opts?: { accountId?: string },
|
||||
) => Promise<unknown>;
|
||||
pushMessageLine: (to: string, text: string, opts?: { accountId?: string }) => Promise<unknown>;
|
||||
pushTextMessageWithQuickReplies: (
|
||||
to: string,
|
||||
text: string,
|
||||
quickReplies: string[],
|
||||
opts?: { accountId?: string },
|
||||
) => Promise<unknown>;
|
||||
createTextMessageWithQuickReplies: (text: string, quickReplies: string[]) => LineReplyMessage;
|
||||
createQuickReplyItems: (labels: string[]) => messagingApi.QuickReply;
|
||||
pushMessagesLine: (
|
||||
to: string,
|
||||
@@ -42,8 +29,14 @@ export type LineAutoReplyDeps = {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
}) => messagingApi.LocationMessage;
|
||||
onReplyError?: (err: unknown) => void;
|
||||
};
|
||||
} & Pick<
|
||||
SendLineReplyChunksParams,
|
||||
| "replyMessageLine"
|
||||
| "pushMessageLine"
|
||||
| "pushTextMessageWithQuickReplies"
|
||||
| "createTextMessageWithQuickReplies"
|
||||
| "onReplyError"
|
||||
>;
|
||||
|
||||
export async function deliverLineAutoReply(params: {
|
||||
payload: ReplyPayload;
|
||||
|
||||
Reference in New Issue
Block a user