7b48f9bc21
* Renamed Module to JanetModule to reduce chance of clashes with NodeJS module * Changes to event dispatcher - different PubSub instances for each type of event * Fixed issues with arguments and scoping when modules triggered
28 lines
497 B
JavaScript
28 lines
497 B
JavaScript
const JanetModule = require('./janetmodule')
|
|
|
|
/**
|
|
* A simple greet module that says a friendly hello when somebody joins
|
|
* @author Lewis Dale
|
|
*/
|
|
class Greet extends JanetModule {
|
|
|
|
constructor(client) {
|
|
super({
|
|
name: 'Greet',
|
|
showInHelp: false,
|
|
command: 'join',
|
|
methods: ['join']
|
|
}, client)
|
|
}
|
|
|
|
respond(event, who) {
|
|
if (who !== "Janet") {
|
|
this.client.say("Hello, " + who)
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = (client) => {
|
|
return new Greet(client)
|
|
}
|