0
我正在为我在plug.dj上运行的房间设计一个自定义脚本,并且为AFK,工作和睡眠实现了自动消息警报。因此,如果您的状态设置为AFK并且有人提到您,他们会收到与AFK状态相关的自动回复消息。下面是该代码:在设定的时间段内创建功能拦截器
function autoRespond(data) {
var a = data.type == "mention" && Models.room.data.staff[data.fromID] && Models.room.data.staff[data.fromID] >= Models.user.BOUNCER, b = data.message.indexOf('@') >0;
if (data.type == "mention") {
if (Models.user.data.status == 1)
API.sendChat("@" + data.from + " automsg: I'm currently AFK");
if (Models.user.data.status ==2)
API.sendChat("@" + data.from + "automsg: I'm currently working");
if (Models.user.data.status ==3)
API.sendChat("@" + data.from + " automsg: I'm currently sleeping");
}
}
我想要做的是,如果在它们被设定为一种状态某人被提及,我想自动消息之前添加一个计时器因为再次活跃。说我有我的设置为AFK,然后有人提到我,他们会收到一个自动回复信息,然后如果有人在计时器中提到我,自动信息无法发送(不延迟,然后在延迟后发送)。我希望我能为此得到正确的帮助,谢谢。