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 { ...@@ -141,6 +141,7 @@ export default class HisoutensokuJammerPlugin implements OnApply {
let messageMatch = receivedMessage.match(matcherGlobal); let messageMatch = receivedMessage.match(matcherGlobal);
if (useCache) { if (useCache) {
const lastMessage = await this.cache.get('lastMessages', sender); const lastMessage = await this.cache.get('lastMessages', sender);
const currentMessage = receivedMessage;
if (lastMessage) { if (lastMessage) {
receivedMessage = `${lastMessage} ${receivedMessage}`; receivedMessage = `${lastMessage} ${receivedMessage}`;
if (!messageMatch) { if (!messageMatch) {
...@@ -148,7 +149,7 @@ export default class HisoutensokuJammerPlugin implements OnApply { ...@@ -148,7 +149,7 @@ export default class HisoutensokuJammerPlugin implements OnApply {
} }
} }
if (!messageMatch) { if (!messageMatch) {
await this.cache.set('lastMessages', sender, receivedMessage); await this.cache.set('lastMessages', sender, currentMessage);
return; return;
} }
await this.cache.del('lastMessages', sender); 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