diff --git a/lib/plugins/plugin.js b/lib/plugins/plugin.js index 16bcfe6..38c0375 100644 --- a/lib/plugins/plugin.js +++ b/lib/plugins/plugin.js @@ -83,16 +83,16 @@ export default class plugin { * @param type 执行方法 * @param isGroup 是否群聊 * @param time 操作时间,默认120秒 - * @param {boolean} [silent=false] 是否静默,超时不回复消息 + * @param reply 超时时回复的内容,false则不回复 */ - setContext(type, isGroup, time = 120, silent = false) { + setContext(type, isGroup, time = 120, reply = "操作超时已取消") { const key = this.conKey(isGroup) if (!stateArr[key]) stateArr[key] = {} stateArr[key][type] = this.e if (time) stateArr[key][type].timeout = setTimeout(() => { if (stateArr[key][type]) { delete stateArr[key][type] - silent || this.reply("操作超时已取消", true) + this.reply(reply, true) } }, time * 1000) }