c76f8e27a7
Simplified the events dispatcher because shared memory references were causing events to be dispatched multiple times
25 lines
497 B
JavaScript
25 lines
497 B
JavaScript
const JanetModule = require('./janetmodule')
|
|
|
|
class Reload extends JanetModule {
|
|
|
|
constructor(client) {
|
|
super({
|
|
name: 'Reload',
|
|
showInHelp: false,
|
|
command: 'load',
|
|
methods: ['pm']
|
|
}, client)
|
|
}
|
|
|
|
respond(event, data) {
|
|
this.client.say("Just checking to see if I've got any new modules...")
|
|
this.client.clearModules();
|
|
this.client.loadModules();
|
|
this.client.say("I'm back now")
|
|
}
|
|
}
|
|
|
|
module.exports = (client) => {
|
|
return new Reload(client)
|
|
}
|