ai/test/__modules__/test.ts

27 lines
472 B
TypeScript
Raw Normal View History

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