File size: 503 Bytes
36ba3ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const Observation = require("./base.js").Observation;

class onSave extends Observation {
    constructor(bot) {
        super(bot);
        this.name = "onSave";
        this.obs = null;
        bot.on("save", (eventName) => {
            // Save entity status to local variable
            this.obs = eventName;
            this.bot.event(this.name);
        });
    }

    observe() {
        const result = this.obs;
        this.obs = null;
        return result;
    }
}

module.exports = onSave;