feat(qqbot): 图片收发功能与定时提醒优化
**图片功能** - 支持接收用户发送的图片消息(自动下载到临时目录) - 支持发送本地文件路径(自动读取转为 Base64) - 富媒体消息接口(sendC2CImageMessage/sendGroupImageMessage) - 图片本地代理服务(解决 QQ 图片 URL 直接访问限制) **消息格式** - 默认启用 Markdown 消息格式 **定时提醒优化** - 修复 cron 提醒:移除无效 --system-prompt 参数,改用 --message 直接输出提醒内容 - 精简用户交互话术,避免冗长回复 **代码清理** - 移除过时的流式消息处理代码 - 优化 gateway/outbound/channel 模块结构
This commit is contained in:
42
src/types.ts
42
src/types.ts
@@ -21,10 +21,8 @@ export interface ResolvedQQBotAccount {
|
||||
systemPrompt?: string;
|
||||
/** 图床服务器公网地址 */
|
||||
imageServerBaseUrl?: string;
|
||||
/** 是否支持 markdown 消息 */
|
||||
/** 是否支持 markdown 消息(默认 false,需要机器人具备该权限才能启用) */
|
||||
markdownSupport?: boolean;
|
||||
/** 是否启用流式消息(仅 c2c 私聊支持),默认 true */
|
||||
streamEnabled?: boolean;
|
||||
config: QQBotAccountConfig;
|
||||
}
|
||||
|
||||
@@ -43,10 +41,8 @@ export interface QQBotAccountConfig {
|
||||
systemPrompt?: string;
|
||||
/** 图床服务器公网地址,用于发送图片,例如 http://your-ip:18765 */
|
||||
imageServerBaseUrl?: string;
|
||||
/** 是否支持 markdown 消息,默认 true */
|
||||
/** 是否支持 markdown 消息(默认 false,需要机器人具备该权限才能启用) */
|
||||
markdownSupport?: boolean;
|
||||
/** 是否启用流式消息,默认 true(仅 c2c 私聊支持) */
|
||||
streamEnabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,37 +121,3 @@ export interface WSPayload {
|
||||
s?: number;
|
||||
t?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 流式消息状态
|
||||
*/
|
||||
export enum StreamState {
|
||||
/** 流式消息开始/进行中 */
|
||||
STREAMING = 1,
|
||||
/** 流式消息结束 */
|
||||
END = 10,
|
||||
}
|
||||
|
||||
/**
|
||||
* 流式消息配置
|
||||
*/
|
||||
export interface StreamConfig {
|
||||
/** 流式状态: 1=开始/进行中, 10=结束 */
|
||||
state: StreamState;
|
||||
/** 分片索引,从0开始 */
|
||||
index: number;
|
||||
/** 流式消息ID,第一次发送为空,后续需要带上服务端返回的ID */
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 流式消息发送上下文
|
||||
*/
|
||||
export interface StreamContext {
|
||||
/** 当前分片索引 */
|
||||
index: number;
|
||||
/** 流式消息ID(首次发送后由服务端返回) */
|
||||
streamId: string;
|
||||
/** 是否已结束 */
|
||||
ended: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user