2017-02-03 23:00:23 +00:00
|
|
|
const JanetModule = require('./janetmodule')
|
2017-02-03 16:28:18 +00:00
|
|
|
|
2017-02-03 23:00:23 +00:00
|
|
|
/**
|
|
|
|
* A simple greet module that says a friendly hello when somebody joins
|
|
|
|
* @author Lewis Dale
|
|
|
|
*/
|
|
|
|
class Greet extends JanetModule {
|
2017-02-03 16:28:18 +00:00
|
|
|
|
2017-02-03 23:00:23 +00:00
|
|
|
constructor(client) {
|
2017-02-03 16:28:18 +00:00
|
|
|
super({
|
|
|
|
name: 'Greet',
|
|
|
|
showInHelp: false,
|
2017-02-03 23:00:23 +00:00
|
|
|
command: 'join',
|
2017-02-03 16:28:18 +00:00
|
|
|
methods: ['join']
|
2017-02-03 23:00:23 +00:00
|
|
|
}, client)
|
2017-02-03 16:28:18 +00:00
|
|
|
}
|
|
|
|
|
2017-02-03 23:00:23 +00:00
|
|
|
respond(event, who) {
|
|
|
|
if (who !== "Janet") {
|
|
|
|
this.client.say("Hello, " + who)
|
|
|
|
}
|
2017-02-03 16:28:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-03 23:00:23 +00:00
|
|
|
module.exports = (client) => {
|
|
|
|
return new Greet(client)
|
|
|
|
}
|