mirror of
https://github.com/syuilo/ai.git
synced 2024-11-14 17:57:59 +00:00
25 lines
442 B
TypeScript
25 lines
442 B
TypeScript
import autobind from 'autobind-decorator';
|
|
import Module from '../../module';
|
|
import Message from '../../message';
|
|
|
|
export default class extends Module {
|
|
public readonly name = 'ping';
|
|
|
|
@autobind
|
|
public install() {
|
|
return {
|
|
mentionHook: this.mentionHook
|
|
};
|
|
}
|
|
|
|
@autobind
|
|
private mentionHook(msg: Message) {
|
|
if (msg.text && msg.text.includes('ping')) {
|
|
msg.reply('PONG!');
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|