Commit 51169acf authored by nanahira's avatar nanahira

check message for one level only

parent 9b27230c
......@@ -141,6 +141,7 @@ export default class HisoutensokuJammerPlugin implements OnApply {
let messageMatch = receivedMessage.match(matcherGlobal);
if (useCache) {
const lastMessage = await this.cache.get('lastMessages', sender);
const currentMessage = receivedMessage;
if (lastMessage) {
receivedMessage = `${lastMessage} ${receivedMessage}`;
if (!messageMatch) {
......@@ -148,7 +149,7 @@ export default class HisoutensokuJammerPlugin implements OnApply {
}
}
if (!messageMatch) {
await this.cache.set('lastMessages', sender, receivedMessage);
await this.cache.set('lastMessages', sender, currentMessage);
return;
}
await this.cache.del('lastMessages', sender);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment