ai/test/_modules_/test.ts

27 lines
468 B
TypeScript
Raw Normal View History

2020-09-19 01:40:44 +00:00
import autobind from 'autobind-decorator';
import Module from '@/module';
import Message from '@/message';
export default class extends Module {
public readonly name = 'test';
@autobind
public install() {
return {
mentionHook: this.mentionHook
};
}
@autobind
private async mentionHook(msg: Message) {
if (msg.text && msg.text.includes('ping')) {
msg.reply('PONG!', {
immediate: true
});
return true;
} else {
return false;
}
}
}