koishi-plugin-onebot-tool
Version:
OneBot 工具集,带有点赞、打卡、拍一拍、表情回应和 AI 语音等功能,可独立开关和自由配置
76 lines (75 loc) • 2.07 kB
TypeScript
import { Context } from 'koishi';
import { Config } from './index';
/**
* QQ群打卡功能管理类
* 处理自动打卡、打卡列表管理和相关命令
*/
export declare class Sign {
/** 打卡目标群ID集合 */
private targets;
/** 模块名称,用于数据存储 */
private moduleName;
/** 日志记录器 */
private logger;
/** Koishi上下文 */
private ctx;
/** 定时任务对象 */
private cronJob;
/** 定时器 */
private timer;
/** 插件配置 */
private config;
/**
* 创建群打卡管理实例
* @param ctx Koishi上下文
* @param config 插件配置
* @param logger 日志记录器
*/
constructor(ctx: Context, config: Config, logger: any);
/**
* 从文件加载打卡目标列表
* @private
*/
private loadTargetsFromFile;
/**
* 启动自动打卡定时器
* @private
*/
private startAutoSignTimer;
/**
* 获取所有群列表
* @param session Koishi 会话对象
* @returns 群ID数组
* @private
*/
private getAllGroups;
/**
* 执行自动群打卡
* @param session 可选,Koishi 会话对象
* @private
*/
private executeAutoSign;
/**
* 处理打卡目标列表的增删查清
* @param action 操作类型:'add'添加, 'remove'移除, 'get'获取, 'clear'清空
* @param groupId 群ID,用于add和remove操作
* @returns 操作结果
*/
handleTargets(action: 'add' | 'remove' | 'get' | 'clear', groupId?: string): Promise<boolean | string[] | Set<string>>;
/**
* 发送群打卡请求
* @param session Koishi 会话对象
* @param groupId 群ID
* @returns 是否打卡成功
*/
sendGroupSign(session: any, groupId: string): Promise<boolean>;
/**
* 注册群打卡相关命令
* @param parentCmd 父命令对象
*/
registerCommands(parentCmd: any): void;
/**
* 释放资源,清理定时任务和计时器
*/
dispose(): void;
}